File won't compile in PBP 2.6



THE BOOK of DT's INTERRUPTS is an organization of interrupt service routines and other works written by Darrel Taylor, RIP.

Interrupt routines are arranged per Darrel's original list. Darrel Taylor's Instant Interrupts are an extension of the work of Tim Box whom in October of 2002 wrote INT_CTRL.pbp

Many of the forum members felt this is a long overdue project.

THE BOOK of DT's INTERRUPTS
will be a valuable resource and a tribute to Darrel Taylor the "Fanatical Contributor".

THE BOOK of DT's INTERRUPTS is located at http://dt.picbasic.co.uk/

+ Reply to Thread
Results 1 to 12 of 12
  1. #1
    Join Date
    Sep 2015
    Posts
    17

    Default File won't compile in PBP 2.6

    Hi All,
    I am very new to PIC programming. I started out with the 12F683 and played with it for a while until I was comfortable with it. I then bought several types to experiment with. I decided to make a template file for each type of PIC that I have. The template file would be a "skeleton" PBP file with all of the configuration settings listed. All but one would be commented out so I could see what config options are available.
    After listing all of the settings and options, I would save and compile this file. If it compiled then I know that my spelling and syntax are correct. If not, then I corrected spelling and syntax, and then recompiled.
    This worked great for 12F683 and various 16F PICs (887,88, 688.628A) However when compiling for the 16F1827 I get the following error messages (see attached).
    Syntax appears to be good; the values are from meConfig. I am using PBP 2.6. I am completely stumped as to why this file will not compile.
    Any help would be greatly appreciated.
    Regards,
    mikejp56
    Attached Images Attached Images  

  2. #2
    Join Date
    Oct 2005
    Location
    Sweden
    Posts
    3,421


    Did you find this post helpful? Yes | No

    Default Re: File won't compile in PBP 2.6

    On the 16F1827 there is no PortC and therefor no TrisC either which would explain the first two errors. The others seems to indicate that the program is too big, which I doubt if it's what you say it is so it might just be a problem due to the first error. If they don't go away you're going to have to post the code so we can see it.

    EDIT: Hmm, it says Program word too large.... So it's probably NOT the "length" of the program it's complaining about after all. But again, if it doesn't go away we (or I at least) need to see the code.

    /Henrik.
    Last edited by HenrikOlsson; - 30th May 2016 at 06:14.

  3. #3
    Join Date
    Oct 2009
    Posts
    582


    Did you find this post helpful? Yes | No

    Default Re: File won't compile in PBP 2.6

    Without showing the code you are trying to compile it's going to be difficult for people to try and diagnose what the cause may be. Paste up the full code you are trying to compile and I'm sure you will get a more definitive answer

  4. #4
    Join Date
    Sep 2015
    Posts
    17


    Did you find this post helpful? Yes | No

    Default Re: File won't compile in PBP 2.6

    Sorry guys,
    It was almost midnight last night when I posted this.
    Here is the code:
    '************************************************* ***************
    '* Name : 16F1827 Template.BAS *
    '* Author : [select VIEW...EDITOR OPTIONS] *
    '* Notice : Copyright (c) 2016 [select VIEW...EDITOR OPTIONS] *
    '* : All Rights Reserved *
    '* Date : 5/29/2016 *
    '* Version : 1.0 *
    '* Notes : *
    '* : *
    '************************************************* ***************
    ;----[16F1827 Hardware Configuration]-------------------------------------------
    ASM
    cfg1 = _FOSC_ECH ; ECH, External Clock, High Power Mode (4-32 MHz): device clock supplied to CLKIN pin
    ;cfg1 = _FOSC_ECM ; ECM, External Clock, Medium Power Mode (0.5-4 MHz): device clock supplied to CLKIN pin
    ;cfg1 = _FOSC_ECL ; ECL, External Clock, Low Power Mode (0-0.5 MHz): device clock supplied to CLKIN pin
    ;cfg1 = _FOSC_INTOSC ; INTOSC oscillator: I/O function on CLKIN pin
    ;cfg1 = _FOSC_EXTRC ; EXTRC oscillator: External RC circuit connected to CLKIN pin
    ;cfg1 = _FOSC_HS ; HS Oscillator, High-speed crystal/resonator connected between OSC1 and OSC2 pins
    ;cfg1 = _FOSC_XT ; XT Oscillator, Crystal/resonator connected between OSC1 and OSC2 pins
    ;cfg1 = _FOSC_LP ; LP Oscillator, Low-power crystal connected between OSC1 and OSC2 pins
    ;------------------------------
    cfg1&= _WDTE_ON ; WDT enabled
    ;cfg1&= _WDTE_NSLEEP ; WDT enabled while running and disabled in Sleep
    ;cfg1&= _WDTE_SWDTEN ; WDT controlled by the SWDTEN bit in the WDTCON register
    ;cfg1&= _WDTE_OFF ; WDT disabled
    ;------------------------------
    cfg1&= _PWRTE_ON ; PWRT enabled
    ;cfg1&= _PWRTE_OFF ; PWRT disabled
    ;------------------------------
    cfg1&= _MCLRE_ON ; MCLR/VPP pin function is MCLR
    ;cfg1&= _MCLRE_OFF ; MCLR/VPP pin function is digital input
    ;------------------------------
    cfg1&= _CP_ON ; Program memory code protection is enabled
    ;cfg1&= _CP_OFF ; Program memory code protection is disabled
    ;------------------------------
    cfg1&= _CPD_ON ; Data memory code protection is enabled
    ;cfg1&= _CPD_OFF ; Data memory code protection is disabled
    ;------------------------------
    cfg1&= _BOREN_ON ; Brown-out Reset enabled
    ;cfg1&= _BOREN_NSLEEP ; Brown-out Reset enabled while running and disabled in Sleep
    ;cfg1&= _BOREN_SBODEN ; Brown-out Reset controlled by the SBOREN bit in the BORCON register
    ;cfg1&= _BOREN_OFF ; Brown-out Reset disabled
    ;------------------------------
    cfg1&= _CLKOUTEN_ON ; CLKOUT function is enabled on the CLKOUT pin
    ;cfg1&= _CLKOUTEN_OFF ; CLKOUT function is disabled. I/O or oscillator function on the CLKOUT pin
    ;------------------------------
    cfg1&= _IESO_ON ; Internal/External Switchover mode is enabled
    ;cfg1&= _IESO_OFF ; Internal/External Switchover mode is disabled
    ;------------------------------
    cfg1&= _FCMEN_ON ; Fail-Safe Clock Monitor is enabled
    ;cfg1&= _FCMEN_OFF ; Fail-Safe Clock Monitor is disabled
    ;------------------------------
    __CONFIG _CONFIG1, cfg1

    cfg2 = _WRT_OFF ; Write protection off
    ;cfg2 = _WRT_BOOT ; 000h to 1FFh write protected, 200h to FFFh may be modified by EECON control
    ;cfg2 = _WRT_HALF ; 000h to 7FFh write protected, 800h to FFFh may be modified by EECON control
    ;cfg2 = _WRT_ALL ; 000h to FFFh write protected, no addresses may be modified by EECON control
    ;------------------------------
    cfg2&= _PLLEN_ON ; 4x PLL enabled
    ;cfg2&= _PLLEN_OFF ; 4x PLL disabled
    ;------------------------------
    cfg2&= _STVREN_ON ; Stack Overflow or Underflow will cause a Reset
    ;cfg2&= _STVREN_OFF ; Stack Overflow or Underflow will not cause a Reset
    ;------------------------------
    cfg2&= _BORV_19 ; Brown-out Reset Voltage (Vbor), low trip point selected
    ;cfg2&= _BORV_HI ; Brown-out Reset Voltage (Vbor), high trip point selected
    ;------------------------------
    cfg2&= _LVP_OFF ; High-voltage on MCLR/VPP must be used for programming
    ;cfg2&= _LVP_ON ; Low-voltage programming enabled
    __CONFIG _CONFIG2, cfg2

    ENDASM
    ;----------Main Program---------------------------------------------------------

    There are no references to any ports or tris registers, just config words.
    And like I said, this is all from meConfig and done in Micro Code Studio.
    Thanks for your help.
    Regards,
    mikejp56

  5. #5
    Join Date
    Mar 2003
    Location
    Commerce Michigan USA
    Posts
    1,166


    Did you find this post helpful? Yes | No

    Default Re: File won't compile in PBP 2.6

    What did you expect? Meconfig is only to help produce the configuration register settings. After it is done, you are to copy them into your oun program.
    Dave Purola,
    N8NTA
    EN82fn

  6. #6
    Join Date
    Aug 2006
    Location
    SWITZERLAND (french part)
    Posts
    802


    Did you find this post helpful? Yes | No

    Default config fuses using MPASM

    If you use Microchip's (MPASM) Assembler, config fuses must be set like:

    Code:
    @ __config _INTRC_OSC_NOCLKOUT & _WDT_ON & _PWRTE_ON & _MCLRE_OFF & _BODEN_ON & _LVP_OFF & _CP_ALL & _DATA_CP_ON
    Roger

  7. #7
    Join Date
    Sep 2015
    Posts
    17


    Did you find this post helpful? Yes | No

    Default Re: File won't compile in PBP 2.6

    Hi Dave,
    That's the point. I have done these templates for about 6 or so PICs without any problems. They are only to set the config bits. Yet for the '1827 they think that I am referring to ports and tris registers. All I'm referring to are config bits.

    Hi flotulopex,
    I might try that next.

  8. #8
    Join Date
    Oct 2005
    Location
    Sweden
    Posts
    3,421


    Did you find this post helpful? Yes | No

    Default Re: File won't compile in PBP 2.6

    It could be a problem with the device specific PBP include file for that device. It might have a PortC and TrisC in it (in error).

    What if you try to compile, without all the CONFIG stuff, something stupid like
    Code:
    Main: 
    Pause 100
    Goto Main
    Does it compile then?

    I don't have 2.6 installed any more so I can't actually test here.

    /Henrik.

  9. #9
    Join Date
    Sep 2015
    Posts
    17


    Did you find this post helpful? Yes | No

    Default Re: File won't compile in PBP 2.6

    Hi Henrik,
    I tried your code and it does not compile.
    The .INC file supplied by meL is listed below:
    ;************************************************* ***************
    ;* 16F1827.INC *
    ;* *
    ;* By : Leonard Zerman, Jeff Schmoyer *
    ;* Notice : Copyright (c) 2009 microEngineering Labs, Inc. *
    ;* All Rights Reserved *
    ;* Date : 06/23/09 *
    ;* Version : 2.60 *
    ;* Notes : *
    ;************************************************* ***************
    NOLIST
    ifdef PM_USED
    LIST
    "Error: PM does not support this device. Use MPASM."
    NOLIST
    else
    LIST
    LIST p = 16F1827, r = dec, w = -302
    INCLUDE "P16F1827.INC" ; MPASM Header
    ;__config _CONFIG1, _FOSC_HS
    ;__config _CONFIG2, _PLLEN_OFF & _LVP_OFF
    NOLIST
    endif
    LIST
    BLOCK_SIZE EQU 8

    Note that I commented out the 2 __config lines.
    So is this file faulty? If so, any ideas on how to repair or replace it?
    Regards,
    mikejp56

  10. #10
    Join Date
    Sep 2015
    Posts
    17


    Did you find this post helpful? Yes | No

    Default Re: File won't compile in PBP 2.6

    Hi Henrik,
    I tried to compile the following code using the original, uncommented .inc file:
    '************************************************* ***************
    '* Name : UNTITLED.BAS *
    '* Author : [select VIEW...EDITOR OPTIONS] *
    '* Notice : Copyright (c) 2016 [select VIEW...EDITOR OPTIONS] *
    '* : All Rights Reserved *
    '* Date : 5/30/2016 *
    '* Version : 1.0 *
    '* Notes : *
    '* : *
    '************************************************* ***************
    It resulted in the error message that is attached. Name:  error messages.JPG
Views: 322
Size:  101.1 KB
    Again, any help or ideas are welcome!
    regards,
    mikejp56

  11. #11
    Join Date
    Oct 2005
    Location
    Sweden
    Posts
    3,421


    Did you find this post helpful? Yes | No

    Default Re: File won't compile in PBP 2.6

    Needless to say it compiles just fine here but I'm on 3.0.8.4 so it doesn't say much.

    The version history for 2.6A says (among other things)
    Fixes assembly errors for 16F1826/16F1827
    If you haven't applied that patch I'd certainly try that, in fact I'd apply 2.6C which is the last version in the 2.x release. When you do it may overwrite the .inc file where you've commented out the CONFIG so be prepared to do that again.

    /Henrik.

  12. #12
    Join Date
    Sep 2015
    Posts
    17


    Did you find this post helpful? Yes | No

    Default Re: File won't compile in PBP 2.6

    Hi Henrik,
    Applying the patch works.
    Thank you so much!
    Regards,
    mikejp56

Similar Threads

  1. Darryl's MIBAM code: won't compile for me!
    By Experimenter in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 10th April 2014, 19:54
  2. Replies: 6
    Last Post: - 21st April 2013, 15:47
  3. Finally trying to do some serial- Won't compile :(
    By cncmachineguy in forum mel PIC BASIC Pro
    Replies: 16
    Last Post: - 26th January 2011, 16:25
  4. 16F877A Microcode Studio won't compile
    By curt66111 in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 25th November 2009, 19:35
  5. Replies: 2
    Last Post: - 10th July 2006, 01:05

Posting Permissions

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