??? 05/29/10 03:24 Modified: 05/29/10 03:27 Read: times |
#176279 - My recommendation... Responding to: ???'s previous message |
Here is what I would propose to you Rowan. Reconfigure your circuit so that your single control line connects to just the DE pin of the MAX483. Then apply a GND connection to the /RE pin to keep the receiver enabled all the time. This scheme eliminates any concerns about switching transients that could occur through enabling and disabling the receiver.
Now whenever you transmit a byte you will simultaneously receive that same byte. This has some significant advantages as follows: 1) You can error check the transmitted bytes by comparing to the corresponding received bytes. 2) You can verify that there is not some other transmitter simultaneously on the bus which would cause the echo back data to be wrong. 3) You can use the timing of the receipt of the last echo byte in a sequence to signal when is the right time to disable the transmitter to allow another end of the bus to respond to the stuff you just sent. Item 3 is particularly useful because, as you may already be aware, you cannot actually disable the RS485 transmitter until after the last byte is fully sent out. If you do it too soon you will cut off the last byte somewhere in its serial bit stream. As a matter of fact item 1 allows you to check your self in this regard!! It can be useful to clear any stray data in the SBUF and the RI status at a point just before you expect to receive some data. I suggest however that if you implement things the way I have suggested you will find little need to do this. Finally note that the receive side of the 'C320 UART will not generally recognize a quick transitional pulse on the RxD pin as a start bit. It is necessary to drive the pin to a start bit level and hold it in that state at least some number of clocks to the UART section before it will be recognized as a valid start bit. I would suggest that you can simply wait around for RI to get set and then respond by checking status and reading SBUF to see what came in. It is the case that if you do not get around to responding to RI and reading SBUF in a prompt manner that another byte that has arrived on RxD will end up getting loaded into SBUF causing loss of the previous byte that was sitting there waiting for you. Use of interrupts to respond to RI is the generally recommended way to ensure timely response to the receipt of UART incoming data. Michael Karas |
Topic | Author | Date |
Receiving serial bytes on 80C320 UART | 01/01/70 00:00 | |
here | 01/01/70 00:00 | |
Thanks - excellent FAQ | 01/01/70 00:00 | |
"bible time" | 01/01/70 00:00 | |
Truly biblical! | 01/01/70 00:00 | |
My recommendation... | 01/01/70 00:00 | |
Useful ideas - but I don't want to change the hardware | 01/01/70 00:00 | |
You are absolutotally unconditionally confused | 01/01/70 00:00 | |
!RI or /RE | 01/01/70 00:00 | |
I'll re-answer the post above | 01/01/70 00:00 | |
Use previous advice and keep receiver enabled | 01/01/70 00:00 | |
This can't be right... | 01/01/70 00:00 | |
How to get it working | 01/01/70 00:00 | |
sometimes right, sometimes wrong | 01/01/70 00:00 | |
e-mailed to Steve, Craig --- forum FYI | 01/01/70 00:00 | |
We're getting there... | 01/01/70 00:00 | |
I believe you are corect.... | 01/01/70 00:00 | |
join the club | 01/01/70 00:00 | |
"No other way??" | 01/01/70 00:00 | |
in my (personal) opinion![]() | 01/01/70 00:00 | |
what is "other code" ? | 01/01/70 00:00 |