Hello all,
I am having a problem with high refresh rates using the RN-41 bluetooth module, sending from PC through bluetooth dongle, to an RN-41 module connected to a microcontroller.
PC → USB Bluetooth Adapter → (wireless) → RN-41 → Microcontroller
My current settings are:
Baud Rate: 38400 bps
Parity: Odd
For this testing, I temporarily disconnect the microcontroller and simply probe the RX pin of the RN-41 with an oscilloscope. When I send a long sequence of data without any pauses or delays, everything appears to be fine. However, when I set a refresh rate on the PC’s end, I encounter some problems. That is, I encounter problems with I do the following.
PC: Send data bytes → Pause N ms → Repeat
When N = ~50 ms, everything appears to be fine. When probing the RX pin, the serial data sequences are separated by 50 ms and there is pretty uniform spacing between sequences.
However, when I make N = 10 ms, I encounter problems. The spacing between sequences is not uniform. Some pulses are separated by 20ish msec, others a little under this, a little more, some 10 (things are just off, though the baud rate is still maintained).
In my PC program, I basically have send sequences in a while loop, and refresh the while loop with a delay. Now one could argue there is something wrong with my program, and perhaps there is. But note:
-
When I send a long sequence with no delays (basically no while loop), the RX line simply sends all the data without long quiescent delays.
-
I tried using a wired RS-232 interface and probed this output. I got pretty uniform spacing and satisfactory results even at refresh rates below 10 ms.
It appears the problem occurs when the bluetooth module is idle, unless I am misinterpretting something. I would appreciate anyone’s comments or suggestions.
Thanks,
Mehdi