This does sound like stack overflow reset. You can turn this option off in config word for a quick test, but to fix it, make sure whenever you use a CALL or GOSUB, that you RETURN instead of GOTO to get back.
This does sound like stack overflow reset. You can turn this option off in config word for a quick test, but to fix it, make sure whenever you use a CALL or GOSUB, that you RETURN instead of GOTO to get back.
Hi,
Have a look at the code below and modify according to your needs to test a stack over/underflow
Code:INIT: 'BELOW IS A CHECK FOR STACK ResetERROR FOR DEBUG ************************************ IF STKPTR.7 = 1 THEN ' CHECK FOR STACK POINTER OVERFLOW HSEROUT ["STACK OVERFLOW"] ' DUMP DATA TO LCD STKPTR.7 = 0 ' CLEAR STACK POINTER OVERFLOW BIT GOSUB DLY5K ' CALL THE 5 SECONDS DELAY SUBROUTINE ENDIF IF STKPTR.6 = 1 THEN ' CHECK FOR STACK POINTER UNDERFLOW HSEROUT ["STACK UNDERFLOW"] ' DUMP DATA TO LCD STKPTR.6 = 0 ' CLEAR STACK POINTER UNDERFLOW BIT GOSUB DLY5K ' CALL THE 5 SECONDS DELAY SUBROUTINE ENDIF
Regards
Sougata
Mots of my problems are solved...
I should have posted earlier in this Forum.
That would have saved me some sleepless nights.
Thanks to all of you.
I'll be back with better problems or better say tasks...
good night
by NVM
Bookmarks