And you may be transmitting the serial data over some RF transceiver which will add its own signal degradation and noise.At high baud rates and/or long cable lengths, these imperfections may become significant.
Exactly my point. The previous calculations seem to assume perfect square edges and perfect transmission lines.if you have transmission channel effects to worry about, you should be calculating how bad those effects can be
Hi U,I have used internal OSC with GPS just fine. That's a couple hundred chars, or more, each burst. I'm pretty sure the hardware UART on the PIC is syncing on every char.
Hi S,Internal OSC is ok for short strings of data, as the error margin can be "caught up" with the stop bit. So even with a 2% error in baud rate, 3 or 4 characters will still be captured properly. However, if sending 40 or 50 characters with no gap/pause between characters, an error in baud rate can accumulate such that the last characters can be totally out of sync.
Internal OSC can also work fine if you put a delay between each character. 1ms at 9600 baud gives an entire character time delay. Even 200us delay between characters would give a 2 bit pause at 9600 baud (approx.). One character at a time with long delays between would allow a baud rate error of close to 10% and still work because each character is received independently before the timing goes out of sync. A pause before the next start bit enables this re-sync to happen.
Hi E,hi,
I tried a number of MCU internal RTC clocks, their long time accuracy was poor, so I switched to the DS3231 RTC module.
The DS3231 long term accuracy is excellent, a second or so in a month, I use them on a SD Data logger projects.
E
I agree with you "MrChips".If the crystal is 20MHz and the baud is 115200 the error is worse.
The divisor is 11.
Hence the actual baud is 20000000 / 16 / 11 = 113636
The error is 1.4%.
This is why you really need a 18.432MHz crystal.
Note however, if your two boards are using crystals of the same frequency (or multiples of the same frequency or some integer fractions) then your error is practically 0%.