I'm still trying to debug this RS232-to-TTL converter board that I've made, shown below.
Now I think I've narrowed down the problem to speed:
- it works fine at 57,600 baud;
- but it inserts some errors during comm at 115,200 baud.
This time I tested the board with a simple echo firmware below, which basically echos back whatever comes into the serial port.
void setup() {
Serial.begin(57600);
}
void loop() {
if (Serial.available() > 0) {
Serial.write(Serial.read());
}
}
At 57,600 baud, it returns a series of B
chars without errors, as below.
BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB
BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB
BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB
BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB
At 115,200 baud, a few errors make into the output.
BBÂBBBBBBBBBBBBBBBBBBBBBBBBBBBBBÂBBBBBBBBBBBBBBBBÂBBBBBBBBBBBBBBBBBBBBBBBBBBBB
BBBBBBBÂBBBBBBBBBBBBBBBBÂBBBBBBBBBBBBBBBBÂBBBBBBBBBBBBÂBBBBBBBBBBBBBBBBBBBBBBB
BBBBBBBBBBBBBBBBÂBBBBBBBBBBBBBBBBÂBBBBBBBBBBBBÂBBBBBBBBBBBBBBBBÂBBBBBBBBBBBBBB
BBBBBBBBÂBBBBBBBBBBBBBBBBBBBBBBBBBBBBBÂBBBBBBBBBBBBBBBBÂBBBBBBBBBBBBBBBBBBBBBB
The error rate seems to be fairly constant and it's always the same. Note that the difference between B
and Â
ASCII char codes is just one bit negated and another one shifted one position left.
B - 01000001
 - 11000010
^ ^
The MAX232 datasheet says it works up to 120 kbps, so I think my board is causing the problem.
So, that's the new evidence I've got so far. My question is: What would be the likely reason for the problems with my converter?
Here's a picture of my board design, if that helps. Disregard the TX and RX LEDs, I've disconnected them.