Is it possible to directly communicate USB D+ D- to Arduino Mega serial port TX RX?
asked Oct 19, 2014 at 11:47
-
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 Stratton– Chris Stratton2014年10月20日 04:46:08 +00:00Commented Oct 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 McMahon– Russell McMahon2015年02月18日 08:52:02 +00:00Commented Feb 18, 2015 at 8:52
1 Answer 1
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.Nafis Abdullah Khan– Nafis Abdullah Khan2014年10月19日 13:25:21 +00:00Commented Oct 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.Gerben– Gerben2014年10月19日 17:49:56 +00:00Commented Oct 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. :)Nafis Abdullah Khan– Nafis Abdullah Khan2014年10月20日 02:16:16 +00:00Commented Oct 20, 2014 at 2:16