I commented on Greg's answer, but would like to add one more thing. For these kinds of problems, the gold standard debugging method is to first understand the asynchronous serial communication, then get an oscilloscope and see what happens on the line. If the characters are exchanged, and this is just a vigorous problem, it will be especially useful, since you can calculate the speed that you see, and then adjust the divider accordingly.
Here is a super fast primer, no doubt you can find something much more complete on Wikipedia or elsewhere.
Assume 8 bits, no parity, 1 stop bit (the most common setting). Then, if the transmitted character says 0x3f (= ascii '?'), Then the line looks like this:
...--+ +---+---+---+---+---+---+ +---+--... | S | 1 1 1 1 1 1 | 0 0 | E +---+ +---+---+
A high (1) level is + 5 V on the chip and -12 V after conversion to RS232 levels.
Low (0) level is 0 V on the chip and +12 V after conversion to RS232 levels.
S is the start bit.
Then we have 8 bits of data that are least significant at first, so here 00111111 = 0x3f = '?'.
E is the stop bit (e for the end).
Time moves from left to right, just like an oscilloscope display. If the speed is 4800, then each bit spans (1/4800) seconds = 0.21 milliseconds (approximately).
The receiver works by taking a sample of the line and distorting the falling edge (a calm line is simply logical “1” all the time). The receiver knows the transmission speed and the number of start bits (1), so it measures half the bit-bit from the falling edge to find the middle of the start bit, then sequentially punches the line for 8 bits in a row after that to collect the data bit. Then the receiver waits for another bit time (half way through the stop bit) and starts looking for another start bit (that is, the falling edge). In the meantime, the symbol read becomes available to the rest of the system. The transmitter ensures that the next falling edge does not start until the stop bit is completed. The transmitter can be programmed to always wait longer (with additional stop bits), but this is an obsolete problem, additional stop bits are only necessary with very slow hardware and / or software settings.