Hi,
I'm not sure if I have:-
a) Discovered a bug
b) Not done something right
c) Hit a known limitation
I'm using a 28x1 and trying to use both the normal serin with a timeout and the Hardware Serial with background receive.
I have found if I call a serin command with a timeout before I check the hserinflag or hserptr then the hardware serial will not receive anything until I issue some sort of serout or sertxd.
eg:-
start:
hserinflag=0
hserptr=0
serin [50,timeout_here],0,T2400_4,b0
timeout_here:
pause 2000 'I now send data in this part
sertxd (#hserinflag,#hserptr)
'at this point both hserinflag and hserptr both equal 0
goto start
If I remove the serin:-
start:
hserinflag=0
hserptr=0
'serin [50,timeout_here],0,T2400_4,b0
timeout_here:
pause 2000 'I now send data in this part
sertxd (#hserinflag,#hserptr)
goto start
hserinflag and hserptr both show data
If I stick a tx command after the serin:-
start:
hserinflag=0
hserptr=0
serin [50,timeout_here],0,T2400_4,b0
serout 0,T2400_4,(b0) 'or sertxd(b0)
timeout_here:
pause 2000 'I now send data in this part
sertxd (#hserinflag,#hserptr)
goto start
hserinflag and hserptr both show data
Its fairly easy for me to work around this, by adding in one of the tx commands but it seems a bit odd to me.
I'm not sure if I have:-
a) Discovered a bug
b) Not done something right
c) Hit a known limitation
I'm using a 28x1 and trying to use both the normal serin with a timeout and the Hardware Serial with background receive.
I have found if I call a serin command with a timeout before I check the hserinflag or hserptr then the hardware serial will not receive anything until I issue some sort of serout or sertxd.
eg:-
start:
hserinflag=0
hserptr=0
serin [50,timeout_here],0,T2400_4,b0
timeout_here:
pause 2000 'I now send data in this part
sertxd (#hserinflag,#hserptr)
'at this point both hserinflag and hserptr both equal 0
goto start
If I remove the serin:-
start:
hserinflag=0
hserptr=0
'serin [50,timeout_here],0,T2400_4,b0
timeout_here:
pause 2000 'I now send data in this part
sertxd (#hserinflag,#hserptr)
goto start
hserinflag and hserptr both show data
If I stick a tx command after the serin:-
start:
hserinflag=0
hserptr=0
serin [50,timeout_here],0,T2400_4,b0
serout 0,T2400_4,(b0) 'or sertxd(b0)
timeout_here:
pause 2000 'I now send data in this part
sertxd (#hserinflag,#hserptr)
goto start
hserinflag and hserptr both show data
Its fairly easy for me to work around this, by adding in one of the tx commands but it seems a bit odd to me.