Page 1 of 1
baud rate for bluetooth
Posted: Thu May 06, 2010 6:53 pm
by st9905
Hello,
I have a project in which I use bluetooth for transmitting data to a controller.
The baud rate is set by default to 9600 by the program (flowcode 4).
I would need higher baud rate for the data transfer.
Is it possible to change the baud rate in any macro?
If so in which macro should i make the change?
I know that when the baud rate is changed I also have to change S520 settings in the bluetooth module.
Regards
Erik
Re: baud rate for bluetooth
Posted: Fri May 07, 2010 9:00 am
by Steve
Flowcode is fixed to communicate with this module at 9600, but you can alter it by customizing the C code for the Bluetooth component.
You will need to customize the [Defines] code, specifically you need to change the %d to an appropriate value in the following line:
At the moment, the Flowcode component calculates the correct value from the current clock speed of the chip and replaces the %d with it in this line. You will need to calculate the appropriate value yourself, but there are some comments in this [Defines] section of code that might help.
Also note that you will need to be communicating at 9600 baud to be able to set the baud rate of the module to something different. And once this value is set, you will need to communicate at the new baud rate. If you get this setting wrong, you may not be able to communicate with the module.
Re: baud rate for bluetooth
Posted: Thu Jul 01, 2010 4:23 pm
by st9905
Hello Steve,
I changed S520 and S521 to 19200.
Then I changed the [Defines] code for the baud rate to 15= 19200.
#define BLU232_BAUD 15
As you wrote something must have gone wrong since I no longer has communication with the module.
Is it possible to write a reset program in Flowcode that can change the mudule back to default or can I throw the module?
Regards
Erik
Re: baud rate for bluetooth
Posted: Sat Jul 03, 2010 12:15 am
by Benj
Hi Erik,
Dont panick all is not lost, your module should be fine.
1) Try reverting the code back to default. This may mean uninstalling and reinstalling. Once you have done this does the module work?
if not then.,
2) Use something like a RS232 or USB232 E-Block to connect the lines of the bluetooth board up to a computer. Then use hyperterminal to play around with the settings until your get a response. Once you have a response you can alter the settings manually and store the new settings in to flash by typing AT commands into hyperterminal (realterm if you have Vista or Win 7).