Interface microcontroller with bluetooth device(SPP)

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Interface microcontroller with bluetooth device(SPP)

3,360 Views
Mat1988
Contributor I

Hi guys,
I need some information about university project.

I'm making a project with microcontroller(HCS08 freescale) and i want to interface it with bluetooth device(PAN1321) that support serial port profile .

I know that must send AT commands to able SPP and so i've RS232 serial cable emulation, but i don't understand very well this; so i've two question:

1)Do i need to implement the code of a RS232 receiver in my micro for recive data, or simply,after connect the devices, i read the data on my UART?
2)The data packets received, are in rs232 format?

Thank a lot in advance

ps:
I still do not have the devices, will arrive next week, but I want to give me an idea

Labels (1)
0 Kudos
2 Replies

568 Views
RogerSchaefer
Contributor III

Hi,

 

I have pulled togeather a lot of Bluetooth information on one page.  Maybe you will find something helpful.

 

http://www.rasmicro.com/Bluetooth.htm

 

Roger

0 Kudos

568 Views
ueli_bucher
Contributor I

Hi Mat1988

I just recently did something similar for a project. It is quite easy if you set up the SCI on your HCS08. I did this using a ringbuffer. (You find example code fairly easy) Set your baudrate in regard of your clock settings and write a parser to handle the incoming commands. To set up the Module you probably get the module into command mode and then you can us AT-Commands.(Parsing commands you might want to look into the stroke function..(http://www.elook.org/programming/c/strtok.html)

 

In order to debug your application i suggest you have a levelshifter thus you can't connect the rx/tx lines of the hcs08 nor the lines from the module driectly to your computer. On the computer simply have a conventional terminal program running like termite or similar.

 

It is also handy to have a smartphone with a bluetooth serial terminal app to connect to your module in order to verify it is running correct and you are receiving the data properly. I used SENA BTerm on an Android phone.

 

Well then, have fun and good luck!

 

0 Kudos