ATmega328P-PU as Keyboard

Hello,

I have already seen some projects with Arduino Micro as a HID keyboard. Example
The question is, could I use ATmega328P-PU for this also?

It is needed the Keyboard.h library, but I can't compile it with ATmega328P-PU (as Arduino Uno) only as Arduino Micro.

Thank you in advance

  • No

The ATmega328P (Arduino Uno) does not have USB hardware, so it cannot directly act as a HID device.

thank you for your answer!

could you please recommend me, which PDIP-x (to use it on breadboard) controller can I use?

PDIP-x

  • What are you referring to ?



  • You have acknowledged you know about the Arduino Micro why are you not then considering it ? :roll_eyes:

this one type, to have chance use breadboard.

i want to use only controller not a dev board.

Sorry, maybe i used not right words, to describe it.

  • The industry has moved away from DIP form factor components, you have no option but SMD now.

  • You might be able to use a SMD to DIP conversion PCB but soldering these QFN SMDs by hand requires a lot of skill.

There are very few microcontrollers with hardware support for USB that are still available in DIP packages. One somewhat surprising possibility is the new Microchip AVR-DU series., which includes a DIP28 version (same size at ATmega328p.) But AFAIK, it isn't supported by Arduino (yet.) (@DrAzzy's DxCore has some support, but it currently pre-dates actual chips, and DrAzzy has been less active recently, so I don't know the actual status.)

There are modules that support hardware USB that are nearly as small and nearly as cheap as individual chips, like the SeeedStudio Xiao line and (pin compatible) Adafruit QTPys (plus a whole bunch of ESP modules (not all of which have HW USB - check carefully.)

It is possible, but...

Deprecation Warning: The Pro Trinket bit-bang USB technique it uses doesn't work as well as it did in 2014, many modern computers won't work well.

You might see if software USB still works, it is the slow end of USB.

This used to work, V-USB.