??? 02/07/08 11:37 Read: times |
#150401 - What kind of protocol.... Responding to: ???'s previous message |
What type of protocol are you using in the RS232 mode?
Is there data flowing both ways, into your MCU and out of it, on the RS232 lines? If so are you fully sure that it is completely non-overlapping? You see that for RS485 to work you can only send one way on the line at a time. Another thing that you need to comprehend is that when the MCU software thinks it is done sending out from the MCU by way of the normal UART status port do note that the last character sent is still in the process of sending and you need to make sure that you allow the sending to fully complete before disabling the transmitter at the MCU end and getting ready for receive mode. The same exact situation will exist at the PC end as well. The PCs UART may still be sending the last byte (or more if FIFOs in UART are in use) even though the App Software on the PC may think the transmit is already finished. If you are using a COMM port adapter at the PC to go to RS485 format that adapter will likely have the transmitter controllable from the PC via the RTS handshake output. Some adapters also use a driver enable scheme called "Send Data Control" where the driver is enabled by a one-shot that triggers and re-triggers on every transition on the TX data coming out of the PC. If this type of adapter is in use the PC end driver will stay enabled till the oneshot times out after the last byte sent. The MCU end will have to be aware of that and wait before trying to transmit until the PCs adapter is off the RS485 bus. -------------- You know if you are simply doing a single point to point connection (that is what would have been going on already when you were using RS232) then maybe there is not a good reason for you to mess around with RS485. Consider instead to use RS422 with a differential pair for data flow to the MCU and another pair to bring the data flow back from the MCU to the PC. It will end up working just like RS232 from a software standpoint but just now able to go the long distance that you get with the two DIFF pairs. Michael Karas |
Topic | Author | Date |
Regarding RS485 interface | 01/01/70 00:00 | |
Nature of Project? | 01/01/70 00:00 | |
To mr.michael | 01/01/70 00:00 | |
What kind of protocol.... | 01/01/70 00:00 | |
To Mr.michael![]() | 01/01/70 00:00 |