PDA

View Full Version : serin or debugin items



iw2fvo
- 3rd November 2010, 14:42
good dat to all of you in the forum!

> I will like to understand if the "timeout " set in the serin or debugin refers to a NO received signals ( or line set to 0Vdc ) or at any kind of signals received ( noise for example ).
If noise is received, does the timeout trigger and send my program to a particular label ?

> can I set a timeout and a "string " after which the received data is stored ?
What will be the correct syntax '

Thanks for any assistance
regards,
Ambrogio

BrianT
- 8th November 2010, 06:40
Timeout only works for a noise free line in the idle state. If the line is in the opposite state timeout is skipped. Likewise if the line has noise, that will be seen as data and never get to the end of the timeout period.

HTH
BrianT

iw2fvo
- 9th November 2010, 20:17
Thanks a lot BrianT.
This is exactly what I was searching for .

Regards,
Ambrogio

iw2fvo
- 9th November 2010, 21:27
Hi, BrianT:

probably you will be able to help me on this item:

I wrote a small program that reads some bytes of data coming from a radio receiver module. I do not want that the receiver program gets stuck in case the transmitter goes off for some reason. The receiver program is this :

SERIN PORTB.0,N1200,["COUNT"],W
SERIN PORTB.0,N1200,["ST0"],S_T.BYTE0
SERIN PORTB.0,N1200,["ST1"],S_T.BYTE1
SERIN PORTB.0,N1200,["SRH0"],S_RH.BYTE0
SERIN PORTB.0,N1200,["SRH1"],S_RH.BYTE1
SERIN PORTB.0,N1200,["WIND"],WND
SERIN PORTB.0,N1200,["IRR0"],IRR.BYTE0
SERIN PORTB.0,N1200,["IRR1"],IRR.BYTE1
SERIN PORTB.0,N1200,["VBAT0"],V_BATT.BYTE0
SERIN PORTB.0,N1200,["VBAT1"],V_BATT.BYTE1

If the transmitter goes off then the receiver locks up waiting for the "STRING". How could I overcome this problem ?

Thanks a lot for any help on the matter.
Regards,
Ambrogio

mackrackit
- 9th November 2010, 23:16
Bruce gave us a work around for this problem.
http://www.picbasic.co.uk/forum/showthread.php?t=12554