| ??? 11/07/02 15:07 Read: times |
#32125 - 8051 UART timing problem? |
I have been researching a serial comms problem involving ModBus host to a 8051 (which I don't think is relevant). Occasionally, received input strings would be corrupt - but not always, and when corrupt, consistently so (same corruption). The first chara in the string is always received ok, but the second and subsequent charas are not.
On analysis, it appears that the start bit of the second, and probably subsequent, chara is being missed, so the 8051 UART is picking up on the next received bit that looks like a start bit - so synchronisation is lost. This only happens when a tight (no idle period between charas) string is transmitted. If I force the transmitting device to 2 stop bit mode (was one), it works perfectly every time. When I look at the string on a scope, the timings (the 1 stop bit times) are precisely 1 bit before the next start bit. At first, I thought it was my setting of the 8051 UART, but there is nothing I can do - it is a pure hardware function - the shifting of bits goes on in the hardware, regardless of what I do. Have I forgotten something? Anyone else found problems when sending full speed strings with 1 stop bit? 80C515, P3.0/3.1, UART Mode 1 (SCON set to 50h), timer 1/mode 2 used (TMOD=5xH)- TH1 loaded with FAh (-6) for 9600Bd (SMOD=0), 22.118MHz clock. Have used this setup for 10 years without problem - this is the first time I have encountered such a thing. TIA, Dave |
| Topic | Author | Date |
| 8051 UART timing problem? | 01/01/70 00:00 | |
| RE: 8051 UART timing problem? | 01/01/70 00:00 | |
| RE: 8051 UART timing problem? | 01/01/70 00:00 | |
| RE: 8051 UART timing problem? | 01/01/70 00:00 | |
| RE: 8051 UART timing problem? | 01/01/70 00:00 | |
| RE: 8051 UART timing problem? | 01/01/70 00:00 | |
| RE: 8051 UART timing problem? | 01/01/70 00:00 | |
RE: 8051 UART timing problem? | 01/01/70 00:00 |



