Brown-out symbol not accepted.


Closed Thread
Results 1 to 7 of 7
  1. #1
    Join Date
    Mar 2011
    Location
    Bangkok Thailand
    Posts
    16

    Default Brown-out symbol not accepted.

    Hi
    I use PBC 2.60B
    I have some problem with the following code. It was written for PIC16F877A but i want to run it with a PIC16F887.

    I have read the data for the PIC16F688 but i cant figure out if it is BOR_OFF or BOREN_OFF i should use. Anyhow non of them semes to work.

    I got the error:

    Error PBC3.ASM 146 : [225] UNDEFINED SYMBOL "BOR.OFF"


    Thank you for any help.

    '************************************************* ***********************
    '* Name : RTC clock with time set buttons.BAS *
    '* Author : [Ole Thronborg] *
    '* Notice : Copyright No *
    '* : All Rights Reserved *
    '* Date : 28-08-2013 *
    '* Version : 1.0 *
    '* Notes : Formly the code was for a PIC16F877A but now *
    '* changed to PIC16F887. *
    '* Error 1 : BOR_OFF is not accepted for PIC16F887 *
    '* Error 2 : Error PBC3.ASM 146 : [225] UNDEFINED SYMBOL "BOR.OFF" *
    '************************************************* ***********************

    @ device pic16F887, HS_OSC, LVP_OFF, BOR_OFF, WDT_OFF
    DEFINE OSC 20
    DEFINE LCD_DREG PORTD
    DEFINE LCD_DBIT 4
    DEFINE LCD_RSREG PORTE
    DEFINE LCD_RSBIT 1
    DEFINE LCD_EREG PORTE
    DEFINE LCD_EBIT 0
    TRISD = $00
    SW1 VAR PORTB.0
    SW2 VAR PORTB.1
    SW3 VAR PORTB.2

    ...

  2. #2
    Join Date
    Aug 2006
    Location
    Look, behind you.
    Posts
    2,818


    Did you find this post helpful? Yes | No

    Default Re: Brown-out symbol not accepted.

    Hello thronborg,
    You will find in your Directory named MPASM suite text files representing every PIC covered by that version of mpasm, and in these text files lie ALL the registers and config fuses available to that particular chip. From the P16F887 file you will find the following:
    Code:
    ;----- CONFIG1 Options --------------------------------------------------
    _LP_OSC              EQU  H'3FF8'    ; LP oscillator: Low-power crystal on RA6/OSC2/CLKOUT and RA7/OSC1/CLKIN
    _XT_OSC              EQU  H'3FF9'    ; XT oscillator: Crystal/resonator on RA6/OSC2/CLKOUT and RA7/OSC1/CLKIN
    _HS_OSC              EQU  H'3FFA'    ; HS oscillator: High-speed crystal/resonator on RA6/OSC2/CLKOUT and RA7/OSC1/CLKIN
    _EC_OSC              EQU  H'3FFB'    ; EC: I/O function on RA6/OSC2/CLKOUT pin, CLKIN on RA7/OSC1/CLKIN
    _INTRC_OSC_NOCLKOUT  EQU  H'3FFC'    ; INTOSCIO oscillator: I/O function on RA6/OSC2/CLKOUT pin, I/O function on RA7/OSC1/CLKIN
    _INTOSCIO            EQU  H'3FFC'    ; INTOSCIO oscillator: I/O function on RA6/OSC2/CLKOUT pin, I/O function on RA7/OSC1/CLKIN
    _INTRC_OSC_CLKOUT    EQU  H'3FFD'    ; INTOSC oscillator: CLKOUT function on RA6/OSC2/CLKOUT pin, I/O function on RA7/OSC1/CLKIN
    _INTOSC              EQU  H'3FFD'    ; INTOSC oscillator: CLKOUT function on RA6/OSC2/CLKOUT pin, I/O function on RA7/OSC1/CLKIN
    _EXTRC_OSC_NOCLKOUT  EQU  H'3FFE'    ; RCIO oscillator: I/O function on RA6/OSC2/CLKOUT pin, RC on RA7/OSC1/CLKIN
    _EXTRCIO             EQU  H'3FFE'    ; RCIO oscillator: I/O function on RA6/OSC2/CLKOUT pin, RC on RA7/OSC1/CLKIN
    _EXTRC_OSC_CLKOUT    EQU  H'3FFF'    ; RC oscillator: CLKOUT function on RA6/OSC2/CLKOUT pin, RC on RA7/OSC1/CLKIN
    _EXTRC               EQU  H'3FFF'    ; RC oscillator: CLKOUT function on RA6/OSC2/CLKOUT pin, RC on RA7/OSC1/CLKIN
    
    _WDT_OFF             EQU  H'3FF7'    ; WDT disabled and can be enabled by SWDTEN bit of the WDTCON register
    _WDT_ON              EQU  H'3FFF'    ; WDT enabled
    
    _PWRTE_ON            EQU  H'3FEF'    ; PWRT enabled
    _PWRTE_OFF           EQU  H'3FFF'    ; PWRT disabled
    
    _MCLRE_OFF           EQU  H'3FDF'    ; RE3/MCLR pin function is digital input, MCLR internally tied to VDD
    _MCLRE_ON            EQU  H'3FFF'    ; RE3/MCLR pin function is MCLR
    
    _CP_ON               EQU  H'3FBF'    ; Program memory code protection is enabled
    _CP_OFF              EQU  H'3FFF'    ; Program memory code protection is disabled
    
    _CPD_ON              EQU  H'3F7F'    ; Data memory code protection is enabled
    _CPD_OFF             EQU  H'3FFF'    ; Data memory code protection is disabled
    
    _BOR_OFF             EQU  H'3CFF'    ; BOR disabled
    _BOR_SBODEN          EQU  H'3DFF'    ; BOR controlled by SBOREN bit of the PCON register
    _BOR_NSLEEP          EQU  H'3EFF'    ; BOR enabled during operation and disabled in Sleep
    _BOR_ON              EQU  H'3FFF'    ; BOR enabled
    
    _IESO_OFF            EQU  H'3BFF'    ; Internal/External Switchover mode is disabled
    _IESO_ON             EQU  H'3FFF'    ; Internal/External Switchover mode is enabled
    
    _FCMEN_OFF           EQU  H'37FF'    ; Fail-Safe Clock Monitor is disabled
    _FCMEN_ON            EQU  H'3FFF'    ; Fail-Safe Clock Monitor is enabled
    
    _LVP_OFF             EQU  H'2FFF'    ; RB3 pin has digital I/O, HV on MCLR must be used for programming
    _LVP_ON              EQU  H'3FFF'    ; RB3/PGM pin has PGM function, low voltage programming enabled
    
    _DEBUG_ON            EQU  H'1FFF'    ; In_Circuit Debugger enabled, RB6/ICSPCLK and RB7/ICSPDAT are dedicated to the debugger
    _DEBUG_OFF           EQU  H'3FFF'    ; In-Circuit Debugger disabled, RB6/ICSPCLK and RB7/ICSPDAT are general purpose I/O pins
    
    ;----- CONFIG2 Options --------------------------------------------------
    _BOR21V              EQU  H'3EFF'    ; Brown-out Reset set to 2.1V
    _BOR40V              EQU  H'3FFF'    ; Brown-out Reset set to 4.0V
    
    _WRT_HALF            EQU  H'39FF'    ; 0000h to 0FFFh write protected, 1000h to 1FFFh may be modified by EECON control
    _WRT_1FOURTH         EQU  H'3BFF'    ; 0000h to 07FFh write protected, 0800h to 1FFFh may be modified by EECON control
    _WRT_256             EQU  H'3DFF'    ; 0000h to 00FFh write protected, 0100h to 1FFFh may be modified by EECON control
    _WRT_OFF             EQU  H'3FFF'    ; Write protection off
    
    ;----- DEVID Equates --------------------------------------------------
    _DEVID1          EQU  H'2006'
    
    ;----- IDLOC Equates --------------------------------------------------
    _IDLOC0          EQU  H'2000'
    _IDLOC1          EQU  H'2001'
    _IDLOC2          EQU  H'2002'
    _IDLOC3          EQU  H'2003'
    For the 16F688:
    Code:
    _BOD_OFF             EQU  H'3CFF'    ; BOR disabled
    _BOR_OFF             EQU  H'3CFF'    ; BOR disabled
    _BOD_SBODEN          EQU  H'3DFF'    ; BOR controlled by SBOREN bit of the PCON register
    _BOR_SBODEN          EQU  H'3DFF'    ; BOR controlled by SBOREN bit of the PCON register
    _BOD_NSLEEP          EQU  H'3EFF'    ; BOR enabled during operation and disabled in Sleep
    _BOR_NSLEEP          EQU  H'3EFF'    ; BOR enabled during operation and disabled in Sleep
    _BOD_ON              EQU  H'3FFF'    ; BOR enabled
    _BOR_ON              EQU  H'3FFF'    ; BOR enabled
    Be aware many of these chips have multiple config, config1 config2, and the appropriate configs must attach to the config numbers where they are listed (the 887 is one of those). See the listing above, notice the _bor21v in the config2 listing . . .
    Last edited by Archangel; - 28th August 2013 at 05:51.
    If you do not believe in MAGIC, Consider how currency has value simply by printing it, and is then traded for real assets.
    .
    Gold is the money of kings, silver is the money of gentlemen, barter is the money of peasants - but debt is the money of slaves
    .
    There simply is no "Happy Spam" If you do it you will disappear from this forum.

  3. #3
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959


    Did you find this post helpful? Yes | No

    Default Re: Brown-out symbol not accepted.

    Since you are using the @ DEVICE statement, it means you are using the old PM assembler.

    The files for the PM assembler are located in the INC subfolder of your PBP folder.
    In there you will find the M16F88X.INC file, which has all of the available configuration options.

    In the case of the 16F887, it's BOD_OFF.
    DT

  4. #4
    Join Date
    Mar 2011
    Location
    Bangkok Thailand
    Posts
    16


    Did you find this post helpful? Yes | No

    Default Re: Brown-out symbol not accepted.

    Hi
    Thank you very much for the quick answer.
    I think its about the 2 different compiler you can choose that confuse me.

    I am running PBP 2.6.0B on a MacBookPro with Windows XP. My Mac is 64bit but i have no clue if Windows XP run 32 or 64bit.

    At the moment i run the MPASM that was installed together with PROTEUS.

    I am a newbie so what is your experience, is it better to choose the MPASM or the MP compiler?

    Thanks Thronborg

  5. #5
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959


    Did you find this post helpful? Yes | No

    Default Re: Brown-out symbol not accepted.

    In the current and future versions of PBP, the PM assembler has been discontinued.
    So it's probably best to write your code using the MPASM options, for future compatibility.

    The PM assembler only worked with standard 12 and 14-bit core devices (12F,16F).
    So for enhanced 14-bit cores (12F1,16F1) or 18F's, you had to switch to MPASM anyhow.
    And since MPASM handles all of the chips, there's really no reason to be switching back and forth between assemblers.
    DT

  6. #6
    Join Date
    Mar 2011
    Location
    Bangkok Thailand
    Posts
    16


    Did you find this post helpful? Yes | No

    Default Re: Brown-out symbol not accepted.

    Thank you very much for the info Darrel.

    Time to upgrade now!

    Thronborg

  7. #7
    Join Date
    Aug 2006
    Location
    Look, behind you.
    Posts
    2,818


    Did you find this post helpful? Yes | No

    Default Re: Brown-out symbol not accepted.

    Quote Originally Posted by thronborg View Post
    . . .

    Time to upgrade now!

    Thronborg
    Even if you do not upgrade you can use mpasm as your compiler, just fill in the check box marked use MPASM, under View . . . Compile and Program . . . Assembler
    If you do not believe in MAGIC, Consider how currency has value simply by printing it, and is then traded for real assets.
    .
    Gold is the money of kings, silver is the money of gentlemen, barter is the money of peasants - but debt is the money of slaves
    .
    There simply is no "Happy Spam" If you do it you will disappear from this forum.

Similar Threads

  1. Browned off by Brown Out [BOD]
    By Squibcakes in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 16th May 2012, 03:25
  2. Power loss - Brown out?
    By clocks in forum General
    Replies: 5
    Last Post: - 25th October 2010, 10:56
  3. brown out resets
    By robertpeach in forum mel PIC BASIC Pro
    Replies: 22
    Last Post: - 4th October 2009, 07:12
  4. Symbol not previously defined
    By Archangel in forum Code Examples
    Replies: 2
    Last Post: - 27th December 2008, 09:52
  5. 12F675: DEC modifier not accepted
    By jswayze in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 1st September 2005, 02:39

Members who have read this thread : 1

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

Tags for this Thread

Posting Permissions

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