Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 06:44 10 Jul 2025 Privacy Policy
Jump to

Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.

Forum Index : Microcontroller and PC projects : USB - IR-Receiver, HID - Keyboard detection of Picomite USB

Author Message
Arne
Newbie

Joined: 05/01/2025
Location: Germany
Posts: 30
Posted: 12:30pm 08 Feb 2025
Copy link to clipboard 
Print this post

I built an IR-Receiver with Digispark. After plug it into the relevant USB-port of my

- Dell - PC (Windows 10)
- Macbook M1 (Mac OS)
- eePC-Netbook (Windows XP)

It was detected as a keyboard an worked as planned.

When I connected the receiver to Picomite - USB nothing happened?

After several changes of the USB-Driver (TrinketHIDCombo, TrinketKeyboard) of the Digispark I deceided to checked the different Versions of Picomite firmware and found following behavior:

A.) Pico 1, VGAUSB Edition 5.09.00RC3
IR-Receiver detected as: Generic Gamepad Connected on channel 1

B.) Pico1, VGAUSB Edition 5.09.00b5
IR-Receiver detected as: Generic Gamepad Connected on channel 1

C.) Pico, VGAUSB Edition 5.09.00 RC3
IR-Receiver detected as: Generic Gamepad Connected on channel 1
If I connect my keyboard only the following is displayed:
US USB Keyboard connechted on channel 1
Generic Gamepad connected on channel 2

D.) Pico, HDMIUSB Edition V6.00.01
IR-Receiver not detected as described on top.

It seems , that the Firmware of the Picomite is the cause of the detection problem?

Has anybody an idea? Need help how to go on/solve the problem.

Arne
 
Mixtel90

Guru

Joined: 05/10/2019
Location: United Kingdom
Posts: 7852
Posted: 12:45pm 08 Feb 2025
Copy link to clipboard 
Print this post

USB device detection on the Pico is much simplified, as you've noticed. There are many. many devices that it doesn't recognise. Basically, all it does recognise are keyboards (most), mice and some gamepads. Everything else is either unrecognised or incorrectly recognised. Some of the restrictions are because of TinyUSB, which is what the PicoMite uses.
Mick

Zilog Inside! nascom.info for Nascom & Gemini
Preliminary MMBasic docs & my PCB designs
 
JohnS
Guru

Joined: 18/11/2011
Location: United Kingdom
Posts: 4037
Posted: 01:05pm 08 Feb 2025
Copy link to clipboard 
Print this post

  Arne said  Need help how to go on/solve the problem.

Arne

Make it identify as an already-supported keyboard if you want it to be detected as a keyboard.

Alternatively, grab the USB code and hack on it till it does what you want.  BTW expect a lot of pain.

The Pico wasn't designed to handle USB.  It struggles to do any USB and is limited due to having no useful hardware for USB let alone a big USB (software) "stack". Windows, MacOS, Linux etc all have big hardware help and big software for USB.

Or maybe find a device that works in the way you want (ESP32?) and connect via that.

hmmm, or just maybe Peter will fancy hacking on the USB code...

John
Edited 2025-02-08 23:08 by JohnS
 
Arne
Newbie

Joined: 05/01/2025
Location: Germany
Posts: 30
Posted: 07:53pm 08 Feb 2025
Copy link to clipboard 
Print this post

Here is the dump of the „USB-Keyboard“:


Information for device Trinket Keyboard (VID=0x1781 PID=0x2434):

------------------------------
Connection Information:
------------------------------
Device current bus speed: LowSpeed
Device supports USB 1.1 specification
Device supports USB 2.0 specification
Device address: 0x0011
Current configuration value: 0x01
Number of open pipes: 1


------------------------------
Device Descriptor:
------------------------------
0x12 bLength
0x01 bDescriptorType
0x0110 bcdUSB
0x00 bDeviceClass      
0x00 bDeviceSubClass  
0x00 bDeviceProtocol  
0x08 bMaxPacketSize0   (8 bytes)
0x1781 idVendor
0x2434 idProduct
0x0100 bcdDevice
0x01 iManufacturer   "Adafruit"
0x02 iProduct        "Trinket Keyboard"
0x00 iSerialNumber
0x01 bNumConfigurations


-------------------------
Configuration Descriptor:
-------------------------
0x09 bLength
0x02 bDescriptorType
0x0022 wTotalLength   (34 bytes)
0x01 bNumInterfaces
0x01 bConfigurationValue
0x00 iConfiguration
0x80 bmAttributes   (Bus-powered Device)
0x32 bMaxPower      (100 mA)

Interface Descriptor:
------------------------------
0x09 bLength
0x04 bDescriptorType
0x00 bInterfaceNumber
0x00 bAlternateSetting
0x01 bNumEndPoints
0x03 bInterfaceClass      (Human Interface Device Class)
0x00 bInterfaceSubClass  
0x00 bInterfaceProtocol  
0x00 iInterface

HID Descriptor:
------------------------------
0x09 bLength
0x21 bDescriptorType
0x0101 bcdHID
0x00 bCountryCode
0x01 bNumDescriptors
0x22 bDescriptorType   (Report descriptor)
0x003F bDescriptorLength

Endpoint Descriptor:
------------------------------
0x07 bLength
0x05 bDescriptorType
0x81 bEndpointAddress  (IN endpoint 1)
0x03 bmAttributes      (Transfer: Interrupt / Synch: None / Usage: Data)
0x0008 wMaxPacketSize    (1 x 8 bytes)
0x0A bInterval         (10 frames)

Microsoft OS Descriptor:
------------------------------
0x00 bLength
0x00 bDescriptorType
Hex dump:


--------------------------------
String Descriptor Table
--------------------------------
Index  LANGID  String
0x00   0x0000  0x0409
0x01   0x0409  "Adafruit"
0x02   0x0409  "Trinket Keyboard"

------------------------------

Connection path for device:
USB-xHCI-kompatibler Hostcontroller
Root Hub
Trinket Keyboard (VID=0x1781 PID=0x2434) Port: 3

Running on: Windows 10 or greater (Build Version 19045)

Brought to you by TDD v2.19.0, Dec  5 2023, 12:08:38


It looks similar to a „real keyboard“ which I connected. Any ideas ?

Arne
 
Arne
Newbie

Joined: 05/01/2025
Location: Germany
Posts: 30
Posted: 10:16am 10 Feb 2025
Copy link to clipboard 
Print this post

Now it is functioning on Picomite - USB too.
I changed some values in the usbconfig.h (VENDOR ID etc.) to data of my keyboard. After compiling the Digispark was detected as a Keyboard on channel 1.

Supported protocols are

* NEC
* NECx
* Philips RC5 and RC5x (simultaneously)
* Sony SIRC 12, 15 and 20 bits (individually or simultaneously)
* SAMSUNG old standard
* SAMSUNG 32 bits (16 of which are for error detection)

Details see https://github.com/LuisMiCa/IRsmallDecoder


Therefore nearly any old remote can be used for PC and Pico remote control. Until now I have checked NEC and SIRC 12.  Also data transfer from Pico to PC and from Pico to Pico (e.g. SIRC12 protocol) is easily possible. So pico could also be used as remote for the PC.

Disadvantage: Data transfer is not very fast/sometimes dropouts…but for remote control ok.

Here a picture of the receiver :







Arne
 
Mixtel90

Guru

Joined: 05/10/2019
Location: United Kingdom
Posts: 7852
Posted: 11:03am 10 Feb 2025
Copy link to clipboard 
Print this post

Are you aware that the PicoMite can read a 38kHz IR receiver using a GPIO pin? It recognises NEC and Sony remotes.
Mick

Zilog Inside! nascom.info for Nascom & Gemini
Preliminary MMBasic docs & my PCB designs
 
Volhout
Guru

Joined: 05/03/2018
Location: Netherlands
Posts: 5050
Posted: 11:15am 10 Feb 2025
Copy link to clipboard 
Print this post

And it can also send these signals

Volhout
PicomiteVGA PETSCII ROBOTS
 
Arne
Newbie

Joined: 05/01/2025
Location: Germany
Posts: 30
Posted: 11:31am 10 Feb 2025
Copy link to clipboard 
Print this post

Yes, I know.

But with this I can control/transfer data to PC, Mac, iPad, Pico, TV etc. directly via USB.
Due macros can directly be performed (e.g. Basic Commands at pico via single keys from a remote) this is a big advantage. Also there is no need to have  GP as input.
I plan to use it to control a „waveshare RP2040 geek“ which has not many GP‘s free.

Arne
 
Arne
Newbie

Joined: 05/01/2025
Location: Germany
Posts: 30
Posted: 11:39am 10 Feb 2025
Copy link to clipboard 
Print this post

@ Volhout

Actually it receives only. The digispark is very limited.

Details see: https://github.com/IRMP-org/IRMP?tab=readme-ov-file

Arne
 
Frank N. Furter
Guru

Joined: 28/05/2012
Location: Germany
Posts: 947
Posted: 08:01am 11 Feb 2025
Copy link to clipboard 
Print this post

@Arne:

Would you please post your code for the Digispark here? I would be very interested!
Thank you very much!!!

Frank
 
Arne
Newbie

Joined: 05/01/2025
Location: Germany
Posts: 30
Posted: 04:42pm 11 Feb 2025
Copy link to clipboard 
Print this post

@ Frank

Here a short description:

1.) On Arduino IDE first install „Board driver“ and Digistump (I used Version 1.6.8):

Details see: https://github.com/ArminJo/DigistumpArduino#installation

2.) Install IRsmalldecoder: https://github.com/LuisMiCa/IRsmallDecoder

3.) Install out of Adafruit-Trinket-USB „Trinket Keyboard“: https://github.com/adafruit/Adafruit-Trinket-USB
On Arduino IDE select with „include library-add ZIP library… “ folder „Trinket Keyboard“. Must not be a ZIP file!

4.)Find library - folder on PC (on my PC it is located C:\Users\myname\AppData\Local\Arduino15\packages\digistump\hardware\avr\1.6.8\libraries\DigisparkKeyboard) and exchange „usbconfig.h“ file to the enclosed file:

usbconfig.zip


5.) Load following test file to Arduino IDE and compile/write to Digispark.


Test_NEC.zip


6.) To test the IR-input open „Windows Edit“ and plug Digispark into PC.
Depend on the selected IR-remote (NEC/SIRC12 etc.) the relevant code will be typed on the edit - window of the PC if abutton is pressed. If you select IR_SMALLD_SIRC12 instead of IR_SMALLD_ NEC before compiling at the Test-Program you can directly send IR-codes from the Picomite via command IR SEND pin, dev, key to the receiver.

If you want to use „special Keyboard codes“ see further description for Adafruit-Trinket-Keyboard. I checked the „cursor control codes up and down“ they worked on PC and Picomite.


Arne
 
Frank N. Furter
Guru

Joined: 28/05/2012
Location: Germany
Posts: 947
Posted: 08:00am 12 Feb 2025
Copy link to clipboard 
Print this post

@Arne:

Thank you very much! I still have a Digispark lying around here - let's see if I can manage to compile your code.
Do I have to set the desired protocol somewhere or does the controller recognize it itself?

Frank
 
Arne
Newbie

Joined: 05/01/2025
Location: Germany
Posts: 30
Posted: 09:52am 12 Feb 2025
Copy link to clipboard 
Print this post

@Frank

The Protocol is set in the source-code (see Test_NEC.zip) in the first line:

#define IR_SMALLD_NEC        //Define NEC Protocol

The different protocols can be selected as described on https://github.com/LuisMiCa/IRsmallDecoder

For Sony Protocol the first line must be e.g.:

#define IR_SMALLD_SIRC12

Arne
 
Frank N. Furter
Guru

Joined: 28/05/2012
Location: Germany
Posts: 947
Posted: 07:29am 13 Feb 2025
Copy link to clipboard 
Print this post

@Arne:

Thanks for the tip! ...now I have to find out which protocol my keyboard works with...

Frank
 
Print this page


To reply to this topic, you need to log in.

The Back Shed's forum code is written, and hosted, in Australia.
© JAQ Software 2025