serial comms between picaxe and bluesmirf

bobcarr

New Member
I don't know if anyone can help me but I'm really struggling here. I'm trying to set up RS232 serial comms between a PC with a bluetooth serial port, and a sparkfun bluesmirf (bluetooth modem) connected to the programming input of a picaxe 18x device. Bluetooth comms are up, but any PC incoming data to an ascii terminal contains gibberish. I am trying to send it a string from the picaxe via sertxd. I guess my problem is to do with baud rate, but have tried the default 2400kbs and the 'X' 4800kbs rates. As you can imagine, I have tried other speeds also, with no success. I feel I am almost there, as the gibberish received is in sync with the picaxe program (which flashes an LED on sertxd output). Has anyone experienced anything like this? I would be really glad to hear from you guys. Regards.
 

Technical

Technical Support
Staff member
This uses 9600 baud so you will have to use N4800 or T4800 (depending on setup) and run the PICAXE at double speed (ie 8MHz - use the setfreq m8 command).
 

bobcarr

New Member
Many thanks for your rapid reply. You guys are great.
I have actually used the bluesmirf AT character set to alter the baud rate at the smirf to suit the picaxe. Seeing that the sertxd setting was fixed at 4800,n,8,1, my first attempt was to set all comms rates to this (the picaxe, the bluesmirf and the programming editor terminal). This won't work. As I say, I have tried most combinations as experiment, because I thought I was almost there (wrong!).
Using the standard download lead my simple code (sertxd "Hello") produces the desired effect, but with the bluetooth modem in circuit, garbage. Yet I know the picaxe is sending my data, its just corrupted.
 

bobcarr

New Member
Just to add a bit more information. Have now tried RF comms with bluemirf using picaxe serout command at 2400 baud, rather than sertxd. The bluesmirf is set to communicate at this speed by setting the ATSW20 command in its control set. The terminal is set to receive at 2400. Still getting the same garbage as before. Setting the bluesmirf to run at a higher baud rate seems to give a closer correlation to the sent characters, but no value I have tried produces the correct result. As I am receiving some data (although corrupt), I still feel its just a matter of hitting the correct timing and protocol. Yet I have tried everything I can think of. Any help would be hugely appreciated. Regards. Glyn
 

bobcarr

New Member
Just to let you know my solution and wrap this up. Managed to achieve what I wanted using serin and serout. Set the bluesmirf to 4800 baud using its own AT command set (downloadable from sparkfun) and using the picaxe T4800 command (definately not N4800).
Having achieved 232 commms, I never did find a way to download a program by connecting the bluesmirf TX via the download lead, perhaps this is because the handshaking and protocols are proprietary. Ah well.
 

hippy

Ex-Staff (retired)
The download protocol uses an RS232 'break' signal which the bluesmirf device probably does not support. Although the break signal uses the same line as data characters do it uses a different format to normal character transmission.
 
Top