PIC16F18855, ASM error when using NAP


+ Reply to Thread
Results 1 to 3 of 3
  1. #1
    Join Date
    Oct 2004
    Location
    Porto - Portugal
    Posts
    30

    Default PIC16F18855, ASM error when using NAP

    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!!!
    nomada

  2. #2
    Join Date
    May 2013
    Location
    australia
    Posts
    2,635


    Did you find this post helpful? Yes | No

    Default Re: PIC16F18855, ASM error when using NAP

    looks like NAP is not compatible with devices that have windowed watch dogs. you could try reporting this as a bug
    or write your own nap routine in asm
    Warning I'm not a teacher

  3. #3
    Join Date
    Oct 2004
    Location
    Porto - Portugal
    Posts
    30


    Did you find this post helpful? Yes | No

    Default Re: PIC16F18855, ASM error when using NAP

    Thank you for your input, Richard
    nomada

Similar Threads

  1. Pic16f18855
    By igninja in forum mel PIC BASIC Pro
    Replies: 0
    Last Post: - 23rd November 2016, 18:45
  2. Pb3 pic12lf1571 asm error
    By markedwards in forum PBP3
    Replies: 1
    Last Post: - 10th June 2016, 06:44
  3. Getting around asm - argument out of range - error
    By longpole001 in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 14th May 2015, 10:33
  4. Missing Operator ASM error
    By retepsnikrep in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 18th June 2012, 07:26
  5. Undefined Symbol error when using ASM interrupt
    By toalan in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 11th January 2005, 21:41

Members who have read this thread : 7

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts