Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
PIC16F1455 error
#1
Hi All,
I am getting the following output error when i build the project in MPLAB v8.89.
Code:
----------------------------------------------------------------------
Release build of project `C:\ds30_Loader_140817\ds30 Loader\firmware_PIC12F_PIC16F\ds30Loader.mcp' started.
Language tool versions: MPASMWIN.exe v5.48, mplink.exe v4.46, mplib.exe v4.46
Tue Nov 24 13:12:55 2015
----------------------------------------------------------------------
Clean: Deleting intermediary and output files.
Clean: Done.
Executing: "C:\Program Files (x86)\Microchip\MPASM Suite\MPASMWIN.exe" /q /p16F1455 "ds30loader.asm" /l"ds30loader.lst" /e"ds30loader.err"
Error[113]   C:\DS30_LOADER_140817\DS30 LOADER\FIRMWARE_PIC12F_PIC16F\SRC\UART.INC 116 : Symbol not previously defined (SPBRG)
Error[113]   C:\DS30_LOADER_140817\DS30 LOADER\FIRMWARE_PIC12F_PIC16F\SRC\UART.INC 118 : Symbol not previously defined (SPBRG)
Halting build on first failure as requested.
----------------------------------------------------------------------
Release build of project `C:\ds30_Loader_140817\ds30 Loader\firmware_PIC12F_PIC16F\ds30Loader.mcp' failed.
Language tool versions: MPASMWIN.exe v5.48, mplink.exe v4.46, mplib.exe v4.46
Tue Nov 24 13:12:56 2015
----------------------------------------------------------------------
BUILD FAILED

Here is my setting.inc file

Code:
;------------------------------------------------------------------------------
;
; Title:            ds30 Loader for PIC12F and PIC16F
;
; File description:    user settings and configuration bits
;
; Copyright:         Copyright 2010-2012 Mikael Gustafsson
;                                                                            
;------------------------------------------------------------------------------

;------------------------------------------------------------------------------
;    This file is part of ds30 Loader.
;
;    ds30 Loader is free software: you can redistribute it and/or modify
;    it under the terms of the GNU General Public License as published by
;    the Free Software Foundation.
;
;    ds30 Loader is distributed in the hope that it will be useful,
;    but WITHOUT ANY WARRANTY; without even the implied warranty of
;    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
;    GNU General Public License for more details.
;
;    You should have received a copy of the GNU General Public License
;    along with ds30 Loader. If not, see <http://www.gnu.org/licenses/>.
;------------------------------------------------------------------------------


;------------------------------------------------------------------------------
; Device
;------------------------------------------------------------------------------
        ;LIST          P=16F1938
        LIST          P=16F1455


;------------------------------------------------------------------------------
; Includes
;------------------------------------------------------------------------------
       #include    "devices.inc"


;------------------------------------------------------------------------------
; User preferences
;------------------------------------------------------------------------------
        radix DEC

        #define        FOSC            4000000            ;xxx
        #define        BLINIT            2000            ;xxx hello receive timeout [ms]
        #define        HELLOTRIES        2                ;xxx number of non hello characters received before branching to the user application
        #define        BLTIME            2000            ;xxx data receive timeout [ms]
        

;------------------------------------------------------------------------------
; UART settings
;------------------------------------------------------------------------------
        #define        USE_UART1        1                ;xxx uncomment to use uart1
        ;#define    USE_UART2        1                ;xxx uncomment to use uart2
        #define        BAUDRATE         19200            ;xxx baudrate
        ;#define    USE_ABAUD        1                ;xxx auto baud rate detection, only available on enhanced mid-range devices(?)
        #define        USE_BRGH        0                ;xxx
        #define        USE_BRG16        0                ;xxx 16-bit brg, only available on enhanced mid-range devices(?)

        ;#define    USE_TXENABLE    1                ;xxx uncomment to use a tx enable pin        
        #ifdef USE_TXENABLE
            #define    TXE_DELAY         10                ;xxx time in us to wait before transmitting after pulling the tx enable pin high
            #define    TRISR_TXE        TRISB            ;xxx tris register containing tx enable
            #define    PORTR_TXE        PORTB            ;xxx port register containing tx enable
            #define    TRISB_TXE        TRISB0            ;xxx tris bit for tx enable
            #define PORTB_TXE        RB0                ;xxx port bit for tx enable
        #endif


;------------------------------------------------------------------------------
; Advanced settings
;------------------------------------------------------------------------------
        ;#define     KICK_WD            1                ;xxx uncomment if the watchdog is enabled
        #define        WRITE_VER        1                ;xxx do flash write verification
        #define        EWRITE_VER        0                ;xxx do eeprom write verification

        #define        BLPLW            256                ;bootloader placement, words from end, should be a multiple of 64
        
                
;------------------------------------------------------------------------------
; Configuration bits, these macros can be found at the end of the inc-files located in
; C:\Program Files\Microchip\MPASM Suite\
;
; These can also be set in MPLAB IDE instead, they are found in Configure->Configuration bits...
;------------------------------------------------------------------------------
        ; Template for standard PIC16F, usually two-three letter like PIC16F88 or PIC16F877
        ;__CONFIG    _CONFIG1, _DEBUG_OFF &_HS_OSC & _WDT_OFF & _PWRTE_OFF & _MCLR_ON & _BODEN_OFF & _LVP_OFF
        ;__CONFIG    _CONFIG2, _IESO_OFF & _FCMEN_OFF

        ; Template for enhanced PIC16F, usually four letter like PIC16F1936
        __CONFIG     _CONFIG1, _FOSC_INTOSC & _WDTE_OFF & _PWRTE_OFF & _MCLRE_ON & _CP_OFF & _BOREN_ON & _CLKOUTEN_OFF & _IESO_OFF & _FCMEN_OFF
        __CONFIG     _CONFIG2, _WRT_OFF & _CPUDIV_NOCLKDIV & _PLLEN_DISABLED & _STVREN_ON & _LVP_OFF


;------------------------------------------------------------------------------
; ds30 Loader commercial version
;------------------------------------------------------------------------------
;-Supports read of flash and EEPROM
;-Supports software UART
;-Read more at www.ds30loader.com


;------------------------------------------------------------------------------
; End of file
;------------------------------------------------------------------------------


 Here is my user code file.
Code:
;------------------------------------------------------------------------------
;
; Title:            ds30 Loader for PIC12F and PIC16F
;
; File description:    user init and exit code
;
; Copyright:         Copyright © 2011, Mikael Gustafsson
;                                                                            
;------------------------------------------------------------------------------

;------------------------------------------------------------------------------
;    This file is part of ds30 Loader.
;
;    ds30 Loader is free software: you can redistribute it and/or modify
;    it under the terms of the GNU General Public License as published by
;    the Free Software Foundation.
;
;    ds30 Loader is distributed in the hope that it will be useful,
;    but WITHOUT ANY WARRANTY; without even the implied warranty of
;    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
;    GNU General Public License for more details.
;
;    You should have received a copy of the GNU General Public License
;    along with ds30 Loader. If not, see <http://www.gnu.org/licenses/>.
;------------------------------------------------------------------------------


;------------------------------------------------------------------------------
; UserInit()
; Description: this is executed immediately on start-up before the boot loader code
;------------------------------------------------------------------------------
UserInit macro     
        ifndef DEV_MODE
            ; Set internal oscillator to 8MHz
            ;banksel    OSCCON
            ;bsf        OSCCON, IRCF0    ;bank 1
            ;bsf        OSCCON, IRCF1
            ;bsf        OSCCON, IRCF2                     
            
            ; Make uart pins digital
            ifdef    ANSEL                
                ;error Do you need to configura uart pins to be digital? If not, remove this line
                ;banksel ANSEL
            endif
            ifdef    ANSELA
                ;error Do you need to configura uart pins to be digital? If not, remove this line
                BANKSEL PORTA ;
                CLRF PORTA ;Init PORTA
                BANKSEL LATA ;Data Latch
                CLRF LATA ;
                BANKSEL ANSELA ;
                CLRF ANSELA ;digital I/O
                BANKSEL TRISA ;
                MOVLW B'00000000' ;Set as outputs
                MOVWF TRISA ;and set
            endif

                ifdef    ANSELC
                ;error Do you need to configura uart pins to be digital? If not, remove this line
                BANKSEL PORTC ;
                CLRF PORTC ;Init PORTC
                BANKSEL LATC ;Data Latch
                CLRF LATC ;
                BANKSEL ANSELC ;
                CLRF ANSELC ;digital I/O
                BANKSEL TRISC ;
                MOVLW B'00000000' ;Set as outputs
                MOVWF TRISC ;and set
            endif
        endif ;DEV_MODE
        endm
        
        
;------------------------------------------------------------------------------
; UserExit()
; Description: this is executed right before the user application is loadaed
;------------------------------------------------------------------------------
UserExit macro
        
        endm
        

;------------------------------------------------------------------------------
; End of file
;------------------------------------------------------------------------------

Any help would be real appreciated :-)
Thanks
Ray


Attached Files
.zip   firmware_PIC12F_PIC16F.zip (Size: 41.99 KB / Downloads: 4)
Reply
#2
hello, in your settings file , do not select any mode available BRGH , you have two options to zero ( BRGH and BRG16 ) , you should be set to 1 of the two , or both , or activate the autobaud rate .

double check at your configuration bits, because not corresponding at the frecuence of the criystal and others options, that depend of your aplicattion.

regards.
Reply
#3
(2015-11-24, 20:46:41)jcca Wrote: hello, in your settings file , do not select any mode available BRGH , you have two options to zero ( BRGH and BRG16 ) , you should be set to 1 of the two , or both , or activate the autobaud rate .

double check at your configuration bits, because not corresponding at the frecuence of the criystal and others options, that depend of your aplicattion.

regards.

Hi Jcca,
I did first of all use a baud rate calculator to find the values of BRGH  and BRGH16 but had the same error. Then i just went through the combinations of both and had the same error on each occasion.

I have tried manually setting the config bits in MPLAB with the same error. I have also tried just compiling a flashing LED code with the same config settings (without the bootloader code) and this works as expected so i am satisfied the config is good.
So the upshot is im still scratching my head on this. Ill spend a little more time today and see what happens.

Thanks for your input :-)
Reply
#4
OK the plot thickens.............................. 
So i decided to test out the comms on the PIC16F1455 without the bootloader stuff. I wrote a small program to flash an LED and this works OK (written in PDS). As soon as i added a routine for the USART i get the same error "SPBRG unknown symbol". So i looked in the register defines for the 1455 and there is no SPBRG register, there is SPGRBL + SPGRBH.

So the upshot is i junked the 1455 and iv ordered some PIC16F1825's that i know work OK. Im guessing that the folks at Microchip went off there beaten path with the register names in the 1455 and hence will not compile correctly..............1 day of wasted time  Big Grin

Thanks
Ray
Reply
#5
It shouldn't be much work to make ds30 Loader compile with the new register names. Do you want me to have a look at it?
Reply
#6
Yes please Mikael that would be great. Im not using the 1455's in my present project but i have around 20 of these in stock so they will get used, with a bootloader, at some point in time.

Thank you
Ray
Reply
#7
Please zip and post your boot loader project.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)