PicBasic Pro and 12f617 compile error


Closed Thread
Results 1 to 7 of 7
  1. #1
    Join Date
    Nov 2010
    Posts
    3

    Default PicBasic Pro and 12f617 compile error

    I am trying to get a simple pic project working and have run into what I think is a bug in the way Picbasic Pro tries to select which bank in the 12f617. First I will list the version of programs I am using.

    Microcode studio 4.0.0.0
    Compiler Pic Basic Pro 2.60a
    MPLAB IDE 8.53.00.00

    I have the studio set to 12f617 for the chip being used and to use the MSAPM listing file and Macro expansion (I turned off quite mode) so that maybe I could get more info on the error messages. In the assembler tab its set to Use MPASM, also list file and macro, no quiet.

    I get the following error(s) when I try to compile my program.

    Message[303] c:\pbp\12f617.inc 22 : Program word too large. Truncated to core size. (FF54)
    Error[113] c:\pbp\pbppic14.lib 7768 : Symbol not previously defined (RP1)
    Error[113] c:\pbp\pbppic14.lib 7769 : Symbol not previously defined (RP0)
    Error[113] c:\pbp\pbppic14.lib 465 : Symbol not previously defined (RP0)
    Error[113] c:\pbp\pbppic14.lib 451 : Symbol not previously defined (RP0)
    Error[113] c:\pbp\pbppic14.lib 517 : Symbol not previously defined (RP0)
    Message[303] c:\pbp\samples\test-c~1.asm 128 : Program word too large. Truncated to core size. (FF54)

    Here is my basic code window.

    Code:
    PAUSE 2000
       
    ANSEL = %00000000
    CMCON0 = 7
    CMCON1 = 7
    ADCON0 = %00000000
    INTCON = 0
    
    GPIO = %000000       
    TRISIO = %000000
    
    Main:
    
    GPIO.0 = 0
    IF GPIO.3 = 1 THEN Main
    GPIO.0 = 1 'TEST LED IS TURNED ON HERE
    PAUSE 2000
    GPIO.0 = 0 'TEST LED IS TURNED OFF HERE
    GOTO Main
    
       End
    I changed the header file a bit, here it is.

    Code:
    ;****************************************************************
    ;*  12F617.INC                                                  *
    ;*                                                              *
    ;*  By        : Leonard Zerman, Jeff Schmoyer                   *
    ;*  Notice    : Copyright (c) 2010 microEngineering Labs, Inc.  *
    ;*              All Rights Reserved                             *
    ;*  Date      : 05/12/10                                        *
    ;*  Version   : 2.60a                                           *
    ;*  Notes     :                                                 *
    ;****************************************************************
            NOLIST
        ifdef PM_USED
            LIST
            include 'M12F617.INC'	; PM header
            device  pic12F617, intrc_osc_noclkout, wdt_on, mclr_on, ioscfs_4mhz, protect_off
            XALL
            NOLIST
        else
            LIST
            LIST P = 12F617, r = dec, w = -302
            INCLUDE "P12F617.INC"	; MPASM  Header
            __config _INTRC_OSC_NOCLKOUT & _WDT_OFF & _MCLRE_OFF & _IOSCFS_4MHZ & _CP_OFF
            NOLIST
        endif
            LIST
    BLOCK_SIZE	EQU	4
    
    #define	EEDATA	PMDATA
    #define	EEADR	PMADR
    #define	EEDATH	PMDATH
    #define	EEADRH	PMADRH
    #define	EECON1	PMCON1
    #define	EECON2	PMCON2
    Any hints to help me get this little project off the ground greatly appreciated.

  2. #2
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default

    Looks like there is something wrong with PBP and this chip.
    I just tried compiling code for a 12F609, known good code, as a 12F617 and received the same errors.
    Dave
    Always wear safety glasses while programming.

  3. #3
    Join Date
    Nov 2010
    Posts
    3


    Did you find this post helpful? Yes | No

    Default

    Should I open a support ticket with PBP? Is that how to get this looked into and fixed?

  4. #4
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default

    If Darrel does not see this tonight and respond to you the yes, open a ticket.

    Oh, and there is a problem with part of your setup. It should be something like this.

    Code:
     
        VRCON = 0           ' Disable internal Vref
        CMCON0 = 0          ' Disable comparators
        ANSEL = 0
    Dave
    Always wear safety glasses while programming.

  5. #5
    Join Date
    Feb 2006
    Location
    Gilroy, CA
    Posts
    1,530


    Did you find this post helpful? Yes | No

    Default

    It looks like part of the problem is Microchip not being consistent from chip to chip with their include file. Their P12f617.INC doesn't have these two lines:

    Code:
    ;----- STATUS Bits -----------------------------------------------------
    C                EQU  H'0000'
    DC               EQU  H'0001'
    Z                EQU  H'0002'
    NOT_PD           EQU  H'0003'
    NOT_TO           EQU  H'0004'
    RP0              EQU  H'0005'
    RP1              EQU  H'0006' 
    IRP              EQU  H'0007'
    The Message[303] warning looks like it is coming from the configuration bits word size, also in Microchip's P12F617.INC file. If you look at the bottom of the file, the config bits go up to FFFF. But if I look in the datasheet, it shows bits 0 to 13, or 3FFF.

    Name:  config-word.PNG
Views: 546
Size:  18.4 KB

    This could be bad advice (I have no way to test the chip), but it does compile correctly if I edit Microchip's P12F617.INC file so that all the config bits begin with a 3, instead of an F.

    Code:
    ;----- CONFIG Options --------------------------------------------------
    _LP_OSC              EQU  H'3FF8'    ; LP
    _XT_OSC              EQU  H'3FF9'    ; XT
    _HS_OSC              EQU  H'3FFA'    ; HS
    _EC_OSC              EQU  H'3FFB'    ; EC
    _INTRC_OSC_NOCLKOUT  EQU  H'3FFC'    ; Internal RC No Clock
    _INTRC_OSC_CLKOUT    EQU  H'3FFD'    ; Internal RC Clockout
    _EXTRC_OSC_NOCLKOUT  EQU  H'3FFE'    ; External RC No Clock
    _EXTRC_OSC_CLKOUT    EQU  H'3FFF'    ; External RC Clockout
    
    _WDT_OFF             EQU  H'3FF7'    ; Off
    _WDT_ON              EQU  H'3FFF'    ; On
    
    _PWRTE_ON            EQU  H'3FEF'    ; On
    _PWRTE_OFF           EQU  H'3FFF'    ; Off
    
    _MCLRE_OFF           EQU  H'3FDF'    ; Internal
    _MCLRE_ON            EQU  H'3FFF'    ; External
    
    _CP_ON               EQU  H'3FBF'    ; On
    _CP_OFF              EQU  H'3FFF'    ; Off
    
    _IOSCFS_4MHZ         EQU  H'3F7F'    ; 4 MHz
    _IOSCFS_8MHZ         EQU  H'3FFF'    ; 8 MHz
    
    _BOR_OFF             EQU  H'3CFF'    ; BOR disabled
    _BOR_NSLEEP          EQU  H'3EFF'    ; BOR enabled in run, disabled in sleep
    _BOR_ON              EQU  H'3FFF'    ; BOR Enabled
    Last edited by ScaleRobotics; - 18th November 2010 at 14:21.
    http://www.scalerobotics.com

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


    Did you find this post helpful? Yes | No

    Default

    In MPLAB 8.60, Microchip has fixed the errors that Walter pointed out.


    MPLAB 8.60 download ...
    http://www.microchip.com/stellent/id...&part=SW007002

    _____________
    DT

  7. #7
    Join Date
    Nov 2010
    Posts
    3


    Did you find this post helpful? Yes | No

    Default

    Thanks to all that responded. I upgraded my MPLAB and the errors went away. I also fixed the other things that were pointed out in my code. It all works now. Now onto slowly building up this code/project to the end goal.

    Thanks again.

Members who have read this thread : 0

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