1 Attachment(s)
SERIN2 - "Timeout" hangs if > 255
Hello There,
I have been working on a tiny GPS project and while I was tuning the code, I noticed that the timeout set to more than a value of 255 would always make the program hang (!).
After googeling a few hours around, I couldn't find a specific answer to my "problem".
Is this value limit mentionned somewhere in the docs or is there something wrong with my code?
any signal or character string?
Thanks mackrackit,
For info, my GPS module sends data @ 1Hz interval. As long as I set my timeout value < 255, the expected result will occur.
Are your saying that timeout will not work if the expected character string OR any signal is received whithin the timeout value? I'm confused.
I use this modified (in red) routine to check if a particular NMEA sentence is sent by the GPS module. In that way, SERIN2 will receive signals and still have the timeout (<255) working - or is this test not valid?
Code:
CHECK_GGA:
SERIN2 GPSfrom,Gpsbps,Timeout,NoGGA,[WAIT("$GPxxxGGA")]
GOTO GPGGA:
NoGGA:
LCDOUT $FE,2, "no xxx"
PAUSE 500
SEROUT2 GPSto,Gpsbps,["$PSRF103,00,00,01,01*25",13,10] 'set ON GGA
GOTO CHECK_GGA:
GPGGA: 'start the next step....