It's amix of many things. One thing scratch my brain
Take care of the Gosub / Return use. It's amazing how fast your program can behave weird when using few nested gosubs...Code:main: input PORTB.0 input PORTD.4 gosub xmit_off gosub wait_for_t0 wait_for_t0: if portb.0= 0 then wait_for_t0 ' loop until rssi goes high
the following snip is the source of your headache
easy to overflow the stack with thisCode:wait_for_t0: if portb.0= 0 then wait_for_t0 ' loop until rssi goes high pulsin portd.4,1,PLENGTH1 ' MEASURE TIME C2 IS HIGH AND STORE IF PLENGTH1 > 255 AND PLENGTH1 < 270 THEN COUNTPULSes ' 42 usec error allowed gosub get_comnd ' made into sub routine get_cmnd 'serin2 b2,16780,1000,wait_for_t0,[WAIT ("$$"),cmnd] ' get command wait $$ timeout 1 secs added 'HSEROUT ["debug command = ",dec2 cmnd,13,10] GOTO wait_for_t0 ' ' ' get_comnd: serin2 b2,16780,1000,wait_for_t0,[WAIT ("$$"),cmnd] ' get command wait $$ timeout 1 secs added HSEROUT ["debug command = ",dec2 cmnd,13,10] return




Bookmarks