PDA

View Full Version : Brown-out symbol not accepted.



thronborg
- 28th August 2013, 01:52
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

...

Archangel
- 28th August 2013, 05:37
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:


;----- 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:


_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 . . .

Darrel Taylor
- 28th August 2013, 15:13
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.

thronborg
- 29th August 2013, 09:11
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

Darrel Taylor
- 29th August 2013, 20:22
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.

thronborg
- 29th August 2013, 22:44
Thank you very much for the info Darrel.

Time to upgrade now! :smile:

Thronborg

Archangel
- 30th August 2013, 03:30
. . .

Time to upgrade now! :smile:

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