Hi there,
I have used the 18F452 for many many applications and it has never let me down. I tend to use it in the HSPLL mode with a 10MHz crystal for full 40MHz speed. Sometimes while using interrupts it is worth noting that this chip has a high priority interrupt vector and pbp uses the low priority. So setting the configuration for interrupts is important. Also if you are using an LCD a few lines of code in the beginning of the program can indicate problems of STACK OVERFLOW (Weird Reboots).
IF STKPTR.7 = 1 THEN ' CHECK FOR STACK POINTER OVERFLOW
LCDOUT "STACK OVERFLOW" ' SHOW IT
STKPTR.7 = 0 ' CLEAR STACK POINTER OVERFLOW BIT
PAUSE 5000 ' LET ME READ THE LCD
ENDIF
IF STKPTR.6 = 1 THEN ' CHECK FOR STACK POINTER UNDERFLOW
LCDOUT "STACK UNDERFLOW" ' SHOW IT
STKPTR.6 = 0 ' CLEAR STACK POINTER UNDERFLOW BIT
PAUSE 5000 ' LET ME READ THE LCD
ENDIF
Regards
Sougata




Bookmarks