On 5/30/15 2:14 PM, Paul Elliott wrote: > But at a hardware level it is still 4 wires. Ground, RX, TX, (and vcc > which need not be dealt with).
USB D+ and D- lines have special signaling voltages & etc. On the microcontrollers I've worked with, they're special-purpose pins, not configurable as general digital I/O and not directly readable or writable. I think you're proposing using D+ and D- as bit-banged serial. For regular I/O pins, this would be possible (although it's a fair amount of work). I don't think it's generally possible for USB pins. > Code for serial lines is very old and well tested. This should > not be difficult. Serial code usually interacts with a UART -- a hardware device that handles timing, start & stop bits, etc. The TX and RX lines are not directly manipulated by the serial code. The code configures the UART and tells it to transmit or receive, and the UART handles all the I/O wiggling. This code wouldn't work for bit-banging serial from some random I/O pin. One way to see if this is even possible would be to try to write userspace code that opens a couple of GPIO pins and see if you can transmit or receive serial data. I'd guess you can do it up to 2400 or maybe 9600 baud, but probably not 115200. If I was going to try to do it, I'd probably implement SPI over the same GPIO pins...no need to do RS232 in this situation, and simpler to do SPI. > It seems to me it should be trivial to do the same thing on the > other end of the line. I don't think "trivial" is the right description, but there are plenty of programmers smarter than me, so... HTH, -- Mersenne Law LLP · www.mersenne.com · +1-503-679-1671 - Small Business, Startup and Intellectual Property Law - 9600 S.W. Oak Street · Suite 500 · Tigard, Oregon 97223
smime.p7s
Description: S/MIME Cryptographic Signature
_______________________________________________ openwrt-users mailing list [email protected] https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-users
