bs2 serin troubles
So I'm using a sparkfun bluesmirf hooked up to a bs2 and sending data from my computer to the bs2. after days of struggling I finally have the bs2 and bluesmirf properly hooked up, and I'm trying to run this program:
BAUDMODE CON 84
serdata VAR Byte
main:
SEROUT 6, BAUDMODE, [noparse][[/noparse]"Activate?"]
SERIN 7, BAUDMODE, 10000, main, [noparse][[/noparse]DEC serdata]
SEROUT 6, BAUDMODE, [noparse][[/noparse]"OK'']
alarm:
leds and piezos that work fine
SEROUT 6, BAUDMODE, [noparse][[/noparse]"Turn off?"]
SERIN 7, BAUDMODE, 10000, alarm, [noparse][[/noparse]DEC serdata]
GOTO main
So the program can get through the first serout just fine. "Activate?" pops up in hyperterminal, but when I go to enter a 1 to fulfill the SERIN on the next line, it usually either takes about fifty tries to move on or simply never moves on.
When it does manage to move on, it gets through the lights and beeping just fine, but gets stalled again at the "turn off?" stage, where again I think simply entering a 1 or other digit should get it to keep going.
this is my first attempt at anything of this nature at all (a month ago, a basic stamp was a completely foreign object)...am I way off base here in thinking that this should work? Is there an easier way to do this? Any ideas as to what's going wrong?
thanks!
BAUDMODE CON 84
serdata VAR Byte
main:
SEROUT 6, BAUDMODE, [noparse][[/noparse]"Activate?"]
SERIN 7, BAUDMODE, 10000, main, [noparse][[/noparse]DEC serdata]
SEROUT 6, BAUDMODE, [noparse][[/noparse]"OK'']
alarm:
leds and piezos that work fine
SEROUT 6, BAUDMODE, [noparse][[/noparse]"Turn off?"]
SERIN 7, BAUDMODE, 10000, alarm, [noparse][[/noparse]DEC serdata]
GOTO main
So the program can get through the first serout just fine. "Activate?" pops up in hyperterminal, but when I go to enter a 1 to fulfill the SERIN on the next line, it usually either takes about fifty tries to move on or simply never moves on.
When it does manage to move on, it gets through the lights and beeping just fine, but gets stalled again at the "turn off?" stage, where again I think simply entering a 1 or other digit should get it to keep going.
this is my first attempt at anything of this nature at all (a month ago, a basic stamp was a completely foreign object)...am I way off base here in thinking that this should work? Is there an easier way to do this? Any ideas as to what's going wrong?
thanks!
Comments
***Settings***
BTA=00066600A45D
BTName=FireFly-A45D
Baudrt=9600
Parity=None
Mode =Slav
Authen=0
Encryp=0
PinCod=1234
Bonded=0
Rem=NONE SET
e
***ADVANCED Settings***
SrvName= SPP
SrvClass=0000
DevClass=1F00
InqWindw=0200
PagWindw=0200
CfgTimer=60
StatuStr=NULL