Is it possible to directly communicate USB D+ D- to Arduino Mega serial port TX RX?
-
1Actually it is possible with some passive components to get close enough to the USB spec to usually be able to bit-bang the lowest speed version in software. I believe on the ATmega328 you can do this with fairly arbitrary GPIOs, presumably you can on a mega as well.– Chris StrattonOct 20, 2014 at 4:46
-
Despite the answer to the contrary it IS possible to access USB directly from digital I/O pins. As TX & RX are also standard digtal I/O pins they could be used for this purpose BUT you need dedicated bootloader code to do this and it has inferior performance if a USB to serial converter is available. The eg ADAFruit Arduino Trinket uses this system.– Russell McMahonFeb 18, 2015 at 8:52
1 Answer
No, D+/- are high frequency USB signals. TX/RX is 5V UART protocol, i.e. compeletely different. But you can e.g. use AT90USB128x processor to avoid 16u2 bridge. The prosessor is not so mighty as 2560 but it's cheaper and simplifies design.
-
Thanks. I knew it but I was thinking may be arduino mega has an option to go through the 2560 UART. I thought it would be the serial port 0 as it is the port for PC serial monitor.– NafisOct 19, 2014 at 13:25
-
1The Arduino Leonardo has a ATMega32u4 witch also supports USB directly. An entire board might be easier than just a raw chip.– GerbenOct 19, 2014 at 17:49
-
Well, I have few couple of Arduino Mega, so, I don't really need to have a Leonardo I think. :)– NafisOct 20, 2014 at 2:16