So, another BT question…
I’ve got two of the older Mitsumi-based bluetooth modules (WML-C40AH using the BlueRadios serial module ATMP firmware). So far, I’ve managed to connect via Hyperterm (on WinXPsp2) at 9600.8.N.1, reconfigured for 115,200 bps, reconnected at that speed, and confirmed communications by getting an “OK” response to the “AT” command. So, I connected to a PIC18 instead, and I’ve got it executing the following pseudo code(straight from the documentation):
atucl (place the local BT module in idle mode)
(100ms pause)
atdm,####<BT.ID>####,1101 (master connect to remote <BT.ID> as SPP)
(100ms pause)
atmf (enable fast data mode on remote BT module)
I wait for PIO2 to go high, then I start streaming serial data from the PIC, and watch it coming across hyperterm from the receiving BT module. Now, I’ve not implemented RTS/CTS between the PIC and the BT module, and the serial stream is generated by a while(1) loop outputting a single character to the serial port of the PIC. If I don’t put a pause in the loop, the data will stream for a while, but some random time later, the stream stops on the RX side and the BT connection drops (sometimes I also get a message from the RX side: “LINKLOSS”) The remote unit goes back to default mode (PIO4 at 1Hz), but the local BT stays connected (PIO2 high) for a while, then PIO2 drops but PIO4 never comes back. If I put a long enough pause between sending characters, I can eliminate these random drops, so I assume I’m overflowing the input buffer on the local BT chip.
Now, the claims are that in fast data mode, 250kbps real payload throughput is possible, while over the air speed is something close to 1Mbps. I understand that there is overhead, and that RF noise can cause retransmits (since the firmware includes guaranteed packet delivery over the RF link, meaning lots of retransmits in a noisy environment). Still, I’m only streaming data at 115kbps, so why isn’t it keeping up? The BT chip’s UART has settings listed for up to 921.6kbps, but what’s the point? Does the RF side clock packets out based on the UART speed? In other words, if I set the UART to a particular speed, do I need to derate my actual serial rate to account for retransmitted packets and such? If I want 250kpbs actual data rate, do I need to have the UART at 921kbps, and then put a delay in my serial output to make it about 250kbps? Is the current 115kbps UART setup only capable of, say, 30 kbps?
Thanks,
Chris