I have recently switched to a new PCB design for my Xmega project. It has a RN-42 bluetooth "modem" which the Xmega talks to via RS232.
I noticed I was getting mostly garbage characters out over bluetooth.
With a 32mhz CPU and 9600 baud, I tried tweaking my baud rate as follows and
found a good clean connection:
Unfortunately, on my previous PCB/same CPU, same RN-42 bluetooth device, I had tweaked the value to 207 to get around the same garbage problem in the past.
207 was not working well with this iteration.
So... what is the procedure for picking a number which is robust? I just went and tried every timing value from 207 - 235. The communications is clean from 208 to 230, garbage below 208, and stops abruptly above 230.
Calculations say it should be 208.27
Baudrate select = (1/(16*(((I/O clock frequency)/Baudrate)-1)
208 = 1/16 * (( 32M / 9600 ) - 1)
So... the spread of 208 to 230 seems a little lopsided!
Mike in Alaska