hi
i am a beginner in pic programming with picbasic.
I am wondering if there is any way I can make a function timeout after 1 second. Here is the code that I tried (on a PIC18F458):
I am not really interested to be 1 second (it can be >0.9 & < 2) somewhere in that interval. Any input is apreciatedCode:DEFINE OSC 20
TIME_COUNTER VAR WORD
INTCON = 0
TIME_COUNTER = 0
While In_STB=1
IF INTCON.2 = 1 THEN
INTCON.2 = 0
TIME_COUNTER = TIME_COUNTER + 1
ENDIF
IF TIME_COUNTER > PRESET THEN GOTO DataDone
Wend
....