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?
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.
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