Arduino UNO is 5V, 16 MHz.

USB 1.1 Low Speed spec operate:

  • at 5V level - so we avoid to maintain voltage level
  • at 1.5 Mb/s - so we have 16/1.5 ~= 10 instructions per elementary protocol signal

Is it possible to make Arduino as slave USB device from UART lines connected to USB D+/D- interface with careful timing and assembler programming?

I doesn't familiar with ATmega328P pin I/O capabilities, may be them can't operate at 1.5 MHz so project isn't possible?

UPDATE I found V-USB library that:

implementation of a low-speed USB device for Atmel’s AVR® microcontrollers,
making it possible to build USB hardware with almost any AVR® microcontroller,
not requiring any additional chip.

Still dig into docs to realize possibilities.

  • The V-USB library is certainly a way of making a Uno act as a low-speed USB device. – Nick Gammon Sep 24 '15 at 21:54

Not exactly the answer to your question, but have you tried the typical way to emulate slave devices with Arduino UNO?

It uses the 2nd ATMega present onboard (this applies only to UNO, afaik) and lets you use the main ATMega for other tasks, delegating the USB protocol to the smaller ATMega16.

Do you have any specific reason why you would use the serial lines?

| improve this answer | |
  • From pointed post: LUFA is an “open source complete USB stack for USB-enabled Atmel Microcontrollers”. I don't fully deep into LUFA docs but pictures show that GPIO pins from microcontroller doesn't directly connected to USB bus and I think that project offloads electrical/protocol USB stuff to corresponding UNO board schematic which does that natively. – gavenkoa Sep 25 '15 at 18:59
  • specific reason is educational, home DIY. – gavenkoa Sep 25 '15 at 19:00
  • I have used extensively LUFA on the ATMega16 that is on the Arduino UNO and I can tell you that it does exactly what I said: the ATMega16 acts as USB gadget device. Are you sure that you are not confusing it with the main AVR chip, the ATMega328P? On Arduino UNO R3 there are 2 AVRs. I'm referring to the secondary. – Igor Stoppa Sep 25 '15 at 19:25
  • If you look at the schematics, you'll see that the TX & RX lines do not only go to the pin header, they also go to the other AVR, which acts as serial to USB adapter. – Igor Stoppa Sep 25 '15 at 19:27
  • With "specific reason" I meant: why do you want to emulate the USB protocol on the ATMega328P when everyone else does it on the ATMega16? From programming perspective, it's identical: they both are AVR, but you have the additional benefit of saving the 328p for implementing some custom functionality. – Igor Stoppa Sep 25 '15 at 19:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.