Tuesday, 16 August 2016

uart - How is this RS485 Module Working?


I am planning to use this UART-to-RS485 module :- http://www.elecrow.com/uart-ttl-to-rs485-twoway-converter-p-1545.html. This module is bidirectional and uses a single pair of differential signal to transmit/receive data. My question is how is the chip deciding whether it has to transmit data from TXD to A+ B- or from A+ B- to RXD?. Shouldn't there be 2 pair of differential signals, one pair for TX and the other pair for RX? What is happening in this module??


enter image description here



Answer



More than likely it switches into transmit mode when TXD becomes active and a diode and capacitor "latch" that first transmit edge and hold that voltage "active" for longer than at least one byte.


I see a little surface mount diode on the PCB (D1) and quite possibly this is what I'm referring to. I have seen this trick done before and the only disadvantage is that when the TX session ends there might be a few milliseconds to wait before the RX direction is restored (due to the capacitor discharging).


I found this on the web as a partial circuit: -



enter image description here


When receiving, TX0 is active high thus forcing a low on DE (as expected). When TX0 goes low it rapidly discharges C0 and sets up the direction port for transmitting. When transmitting and TX data changes state, C0 remains largely discharged although ultimately R3 will slowly (relatively speaking) re-charge it but not until some time after the last transmit byte has been sent. Values shown i.e. 22k and 1000pF are dependent on baud rate.


No comments:

Post a Comment

arduino - Can I use TI's cc2541 BLE as micro controller to perform operations/ processing instead of ATmega328P AU to save cost?

I am using arduino pro mini (which contains Atmega328p AU ) along with cc2541(HM-10) to process and transfer data over BLE to smartphone. I...