Greetings to all...
I´ve searched the forum and havent't found info about this problem and can not figure what i'm doing wrong:
I need to use NAP from 2 to 8 seconds, just for low power mode in a small program that check two keys.
I'm using MCSplus Version 5.0.0.5 with PBP 3.1.1.0
When Microcode does it's magic I get the message below:
[ASM ERROR] Symbol not previously defined (WDTCON) (0): Error[113]
The code is as follows:
'************************************************* ***
* Name : Key_test_with_NAP.PBP
'* Author : José Vicente
'* Notice :
'* Date : 11-06-2025
'* Version : 1.0
'* Notes : PIC16F18855
'* :
'************************************************* ***
#CONFIG
__config _CONFIG1, _FEXTOSC_OFF & _RSTOSC_HFINT32 & _CLKOUTEN_OFF & _CSWEN_ON & _FCMEN_ON
__config _CONFIG2, _MCLRE_OFF & _PWRTE_ON & _LPBOREN_OFF & _BOREN_OFF & _BORV_LO & _ZCD_OFF & _PPS1WAY_OFF & _STVREN_OFF & _DEBUG_OFF
__config _CONFIG3, _WDTCPS_WDTCPS_11 & _WDTE_ON & _WDTCWS_WDTCWS_7 & _WDTCCS_LFINTOSC
__config _CONFIG4, _WRT_ON & _SCANE_available & _LVP_ON
__config _CONFIG5, _CP_ON & _CPD_OFF
#ENDCONFIG
DEFINE OSC 08
OSCFRQ = %011
ANSELA =%00000000
ANSELB =%00000000
ANSELC = 0
TRISA=%00000011
TRISB=%00000000
TRISC=%00000000
key1 VAR PORTA.0 ' selection key#1
key2 VAR PORTA.1 ' selection key#2
led VAR PORTA.2 '
warning VAR PORTA.3 ' program running inside nap routine
n var bit
PORTB=%00000000
PORTC=%00000000
warning=0
led=0
pause 500
it_starts_here: ' main program runs in here
' ...code that search if the keys are pressed or not
' ...after some time, if keys not pressed goes to wakeup
goto it_starts_here
' .... some stuff here
wakeup:
nap 7 ' it goes into low power mode until wakes up
Warning=1 ' warning led goes on
pause 100
warning=0 ' warning led goes off
pause 100
goto wakeup
' .... some more stuff here
end
----------------------------------------------------------------
Thanks!!!
Bookmarks