Electronics > Beginners
Bi-directional uart
piam:
I do have a USB to RS232 dongle, but it feels really ugly going from USB to RS232 to TTL to this single pin interface via two chips that I don't (yet) have and that seem superfluous. I was thinking of using http://abyz.me.uk/rpi/pigpio/cif.html to do this UART in software. I do have those two chips on order and should get them in a few days. Would be good not to have to use them though.
I don't actually need 5v anywhere, that's just because of the RS232.
piam:
--- Quote from: mvs on January 09, 2020, 11:50:49 am ---74hc125 is just cheap Tri-state buffer. You may replace it with a small signal diode (cathode to RPi TX, anode to RPi RX and PTA0 + Pullup R).
--- End quote ---
Cool, that sounds like a plan. Thanks.
Berni:
Ah you want to go the other direction.
In that case just use the same 74HC125 circuit and instead of connecting it to the MC145407 you connect it to the TX and RX pin on a raspberry.
You can try bitbanging UART but you will have a world of trouble getting it to work at anything higher but the slow snails pace baudrates. Id say paying for a 10 cent 74 series quad buffer IC is cheaper than investing days of work to do it with direct connection to the Raspberry IO pin.
piam:
--- Quote from: Berni on January 09, 2020, 12:05:58 pm ---In that case just use the same 74HC125 circuit and instead of connecting it to the MC145407 you connect it to the TX and RX pin on a raspberry.
You can try bitbanging UART but you will have a world of trouble getting it to work at anything higher but the slow snails pace baudrates. Id say paying for a 10 cent 74 series quad buffer IC is cheaper than investing days of work to do it with direct connection to the Raspberry IO pin.
--- End quote ---
At the moment, because of the crystal I have (ordered some more), it'll be 13240 baud... I'm not sure of the status of my orders, but if I don't get the stuff I want by tomorrow, I might try the software mechanism in the interim.
piam:
--- Quote from: mvs on January 09, 2020, 11:50:49 am ---74hc125 is just cheap Tri-state buffer. You may replace it with a small signal diode (cathode to RPi TX, anode to RPi RX and PTA0 + Pullup R).
--- End quote ---
This is exactly what I did (I think!). For every byte I write I get it echoed back and then I get the data I'm expecting. I have some anomalies with failed reads after a while but I can just work around those by repeating the command I'm sending.
Thanks
Navigation
[0] Message Index
[*] Previous page
Go to full version