SparkFun Forums 

Where electronics enthusiasts find answers.

Have questions about a SparkFun product or board? This is the place to be.
By SHN
#177917
Hi,
I use Bluetooth module (BTM182) to send Data from micro controller (PIC) to computer. I have changed the bluetooth baud rate (from 19200 to 57600) using AT commands due to these links:
http://www.compsys1.com/support/BTM/BT_serial.pdf

http://www.compsys1.com/support/BTM/SPP ... %20set.pdf

So I expected that by increasing the baud rate. I can see increasing in signal rate. But for baud rate 57600, "char count" (in 10 second) is near 8000 (I have checked baud rate using "Real-TERM"). I have tried other baud rates and signal rate is not true for all (expect 19200 that is default baud rate).


Could you please help me to know what is the problem? I really need to send data to computer with high signal rate (baud rate 57600 ) for my school project.

Thank you in advance for any help you could provide.

Regards,
Shiva
User avatar
By Ross Robotics
#177926
It's not just the baud rate speed that you need to look at. You could have the baud rate set to a million but it's only has fast as the slowest component. You need to look at the hardware, that may be the bottle neck.
By Mee_n_Mac
#177932
To amplify on the above ...

@ the OP :

1) How do you control the flow of data from the core of the PIC to it's UART ? How fast can the PIC, using the code you have now, put data into the UART ? As a test I'd take the UART's TTL serial output and route it instead to a USB<->serial adapter (which you must have to set the BT module) and measure the rate the way you have been, but for that COM port.

2) Can you tell, at the PC end, how many packets are being lost ? If you have a poor RF connection for what ever reason, the BT module may be doing a (lot of) re-transmit(s) and that will slow down the overall data rate. IIRC BT 2.0 should be good for 80+ kbs.
By SHN
#178030
Thank you for your help.
But I don't understand completely what should I do for this problem??
Actually, I don't know anything about control the flow of data that you said?
Could you please explain more about that and help me to know what should I do?

By the way, I want to make sure that if the baud rate of BTM182 is changed only by using "AT Command (ATL4)" ?? or, Is there anything else as a AT Commands that must be used to change the baud rate?? or, Is there any component that must be changed for changing the baud rate?

Thank you for any help
Regards,
By waltr
#178036
That PIC does not have any hardware flow control built in. You must write code to use some IO pins for hardware flow control (RTS, CTS) and and your code must handle this.
Same if you would rather have Soft Flow control (uses Flow control characters in the ASCII character set). Your code must do this.
By SHN
#178051
Thanks a lot.
I want to make sure that if the baud rate of BTM182 is changed only by using "AT Command (ATL4)" ?? Please help me to know about that.
Best Regards
By Valen
#178054
Once you changed the baudrate in the bluetooth module you also must change the baudrate in the pic to the same rate. Or else they will not understand each other. In some devices this default value can be stored in permanent ram. But the AT command do not suggest that it is possible for this module. So after a software reset or powercycle this should be reset to 19200.

The only way to tell what the baud rate is, is by measuring the bit-duration with a oscilloscope or logic analyser. If you do not have that then the only other solution is to try to set the baudrate on your pic to every possible value and interrogate the device with unknown baudsetting. (Brute-force test) If it does not respond then you can assume that the baud settings do not match.