baud rate for bluetooth

For questions and comments on programming in general. And for any items that don't fit into the forums below.

Moderators: Benj, Mods

Post Reply
st9905
Flowcode V4 User
Posts: 16
Joined: Tue Oct 24, 2006 5:41 pm
Contact:

baud rate for bluetooth

Post 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
Erik

User avatar
Steve
Matrix Staff
Posts: 3422
Joined: Tue Jan 03, 2006 3:59 pm
Has thanked: 114 times
Been thanked: 422 times
Contact:

Re: baud rate for bluetooth

Post 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:

Code: Select all

#define BLU232_BAUD			%d
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.

st9905
Flowcode V4 User
Posts: 16
Joined: Tue Oct 24, 2006 5:41 pm
Contact:

Re: baud rate for bluetooth

Post 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
Erik

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: baud rate for bluetooth

Post 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).

Post Reply