Arduino Nano as USB HID-Device

Hello

I'm using a Nano V3.0 mit Atmega328 CH340 of AZ-Delivery. It should be completely compatible with a Adruino Nano.
What I'm trying to do is to communicate with the a PLC via the serial USB-interface.
Unfortunately, the PLC is only able to communicate with several interface classes.

The following list shows the supported interface classes of the PLC.

  • Mass storage devices - interface class 0x08
  • Printers - interface class 0x07
  • HID-Devices - interface class 0x03
  • USB-Hub's - interface class 0x09

My Nano appears as a wendor specific device with e interface class 0xFF.

Now to my question.
Is there any possibility to configure the Nano to appear and to act as HID device?<
If not, is it a problem of the controller? Are other controllers able to appear as HID device?

Thanks for your help in advance.

No.

It is the USB to serial chip that doesn't have the capability of being made to communicate as a HID device.

Arduinos like the Leonardo and Micro can be used to communicate in the HID mode.

Sadly it is not. The processor chip is the same but the USB to serial interface is not. So they are not being strictly truthful.

Thanks for your fast and competent anser.

How can I figure out if a controller is able to run in HID mode?
What are the circumstances shich must be fullfilled?

Tanks in advance and best regards

There are no easy answers to this and it is not just a tick list you can go through. The USB is a simple to use interface, and you pay for that with all the software laters that sit underneath the hardware.

But basically there must be some USB capability in either the main processor chip or the chip that performance the USB / serial interface.

You will normally see this in the product specification of the Arduino you are looking at. Most of the 3V3 Arm based processors can do this, like the the Due or Zero or the later Teenseys.

You will not normally see this in the 8 bit controller chips like the ATMega 328, of the Nano and Uno.

If you don't see it in the product specification look at the first page of the data sheet to see if it is mentioned as a feature. If it is not there it is a far bet it can't be used as one.

Thanks a lot for your questions so far.
I organized a Arduino Micro now and tested the HID-Project Library with its features.
Using the Arduino as a Keyboard, Mouse or Joystick is quite easy and works pretty cool.

But independantly of what mode I'm using (Keyboard/Mouse/Joystick/RawHID) the controller expresses itself always as a device with the USB interface class 0x02 "Communication device class"

What I need is to have it as a RawHID device which is able to read and write data, but with the Usb interface class 0x03 "human interface device class HID"

Can it be changed or configured somehow?
Thanks for your answers in advance.

Not sure but the MIDI HID class can be got using the #include "MIDIUSB.h"
It is just a matter of finding the right library I suppose.

Thanks for the fast response Grumpy_Mike.
But I do not agree,
If the library MIDIUSB.h is included, the interface class remains the same (0x02 Communication device class")
So importing another library roes not change the class directly

Surely this depends on the library that you import does it not?
It depends on the end points definition in the imported library.

I came across this :-
usbmultiple configurations
Reply #2 seems to offer the most information.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.