MPLAB Configuration


Closed Thread
Results 1 to 5 of 5
  1. #1
    Join Date
    Aug 2003
    Posts
    985

    Default MPLAB Configuration

    Hi Guys,
    I'm using an older version of both PBP and MPLAB (the CD sent out when PicKitII was sold).
    I don't want to upgrade because previous projects compiled with it rely on org statements, etc.
    It would be very bad for me if any PBP code changed it's compiled size.

    Although I have compiled and run an LCD program,
    all of my previous projects have "source level debugging" enabled.
    With this fresh install, I have to disable that option, or I will get a "Cannot access COD file" error.

    Furthermore, I do something like this:
    Code:
    '
    @ DEVICE LVP_OFF,BOD_OFF,HS_OSC					'set device configuration
    DEFINE OSC 20							'hardware is using a 20MHz crystal
    '
    This no longer compiles, and I have to comment out the raw configuration.
    I know you can probably set the same bits with PBP directly,
    but the point is there's some difference if it won't compile now.

    With the asm line commented, it does compile and run,
    but I don't know the default brown out detect setting (for example)
    if the PicKitII is going to be set to write the pic at build time.

    Does any of this sound familiar to anybody?
    As far as I know, I'm not doing anything different.
    Cheers, Art.

  2. #2
    Join Date
    Jan 2005
    Location
    Montreal, Quebec, Canada
    Posts
    2,597


    Did you find this post helpful? Yes | No

    Default Re: MPLAB Configuration

    Did you update MPASM without noticing?

    Did you accidentally change the flag that choses assembler version?

    Robert

    Edit: "with this fresh install" - as in format and start fresh?

    If so, you must have picked up something else. I keep all my older versions and patches, along with an INSTALL checklist which I follow religiously.

    Captain Obvious
    Last edited by Demon; - 14th October 2013 at 02:42.

  3. #3
    Join Date
    Aug 2003
    Posts
    985


    Did you find this post helpful? Yes | No

    Default Re: MPLAB Configuration

    I think my old projects were previously compiled with PM, but now using MPASM.

    I can't update MPASM, it comes from the CD I use that came with PicKIT II
    The particular Windows install has never seen the internet.

    This is understood by PM:
    Code:
    @ DEVICE LVP_OFF,BOD_OFF,HS_OSC					'set device configuration
    MPASM wants something like

    Code:
    CONFIG
    ...
    asm config goes here
    
    ENDCONFIG
    It looks good now.. maybe just some fiddling to do.
    I still don't know how to set Brown Out Detect, HS_OSC in source,
    but I think MPLAB provides for configuring the hex file.

    Lol,
    I have made my own checklist (including photos of the path string) this time

  4. #4
    Join Date
    May 2004
    Location
    NW France
    Posts
    3,614


    Did you find this post helpful? Yes | No

    Default Re: MPLAB Configuration

    Ok, Art

    PM did not call the config options as MPASM does ...

    so, what to do ???

    Open the .inc file corresponding to your processor in the MPASM folder ...

    here: C:\Program Files\Microchip\MPASM Suite

    example for 16F628 ...

    at the bottom of the file, you see :

    ;================================================= =========================
    ;
    ; Configuration Bits
    ;
    ; NAME Address
    ; CONFIG 2007h
    ;
    ;================================================= =========================

    ; The following is an assignment of address values for all of the
    ; configuration registers for the purpose of table reads
    _CONFIG EQU H'2007'

    ;----- CONFIG Options --------------------------------------------------
    _FOSC_LP EQU H'3FEC' ; LP oscillator: Low-power crystal on RA6/OSC2/CLKOUT and RA7/OSC1/CLKIN
    _LP_OSC EQU H'3FEC' ; LP oscillator: Low-power crystal on RA6/OSC2/CLKOUT and RA7/OSC1/CLKIN
    _FOSC_XT EQU H'3FED' ; XT oscillator: Crystal/resonator on RA6/OSC2/CLKOUT and RA7/OSC1/CLKIN
    _XT_OSC EQU H'3FED' ; XT oscillator: Crystal/resonator on RA6/OSC2/CLKOUT and RA7/OSC1/CLKIN
    _FOSC_HS EQU H'3FEE' ; HS oscillator: High-speed crystal/resonator on RA6/OSC2/CLKOUT and RA7/OSC1/CLKIN
    _HS_OSC EQU H'3FEE' ; HS oscillator: High-speed crystal/resonator on RA6/OSC2/CLKOUT and RA7/OSC1/CLKIN
    _FOSC_ECIO EQU H'3FEF' ; EC: I/O function on RA6/OSC2/CLKOUT pin, CLKIN on RA7/OSC1/CLKIN
    _EXTCLK_OSC EQU H'3FEF' ; EC: I/O function on RA6/OSC2/CLKOUT pin, CLKIN on RA7/OSC1/CLKIN
    _FOSC_INTOSCIO EQU H'3FFC' ; INTRC oscillator: I/O function on RA6/OSC2/CLKOUT pin, I/O function on RA7/OSC1/CLKIN
    _INTRC_OSC_NOCLKOUT EQU H'3FFC' ; INTRC oscillator: I/O function on RA6/OSC2/CLKOUT pin, I/O function on RA7/OSC1/CLKIN
    _FOSC_INTOSCCLK EQU H'3FFD' ; INTRC oscillator: CLKOUT function on RA6/OSC2/CLKOUT pin, I/O function on RA7/OSC1/CLKIN
    _INTRC_OSC_CLKOUT EQU H'3FFD' ; INTRC oscillator: CLKOUT function on RA6/OSC2/CLKOUT pin, I/O function on RA7/OSC1/CLKIN
    _FOSC_ERIO EQU H'3FFE' ; ER oscillator: I/O function on RA6/OSC2/CLKOUT pin, Resistor on RA7/OSC1/CLKIN
    _ER_OSC_NOCLKOUT EQU H'3FFE' ; ER oscillator: I/O function on RA6/OSC2/CLKOUT pin, Resistor on RA7/OSC1/CLKIN
    _FOSC_ERCLK EQU H'3FFF' ; ER oscillator: CLKOUT function on RA6/OSC2/CLKOUT pin, Resistor on RA7/OSC1/CLKIN
    _ER_OSC_CLKOUT EQU H'3FFF' ; ER oscillator: CLKOUT function on RA6/OSC2/CLKOUT pin, Resistor on RA7/OSC1/CLKIN

    _WDTE_OFF EQU H'3FFB' ; WDT disabled
    _WDT_OFF EQU H'3FFB' ; WDT disabled
    _WDTE_ON EQU H'3FFF' ; WDT enabled
    _WDT_ON EQU H'3FFF' ; WDT enabled

    _PWRTE_ON EQU H'3FF7' ; PWRT enabled
    _PWRTE_OFF EQU H'3FFF' ; PWRT disabled

    _MCLRE_OFF EQU H'3FDF' ; RA5/MCLR pin function is digital input, MCLR internally tied to VDD
    _MCLRE_ON EQU H'3FFF' ; RA5/MCLR pin function is MCLR

    _BOREN_OFF EQU H'3FBF' ; BOD Reset disabled
    _BODEN_OFF EQU H'3FBF' ; BOD Reset disabled
    _BOREN_ON EQU H'3FFF' ; BOD Reset enabled
    _BODEN_ON EQU H'3FFF' ; BOD Reset enabled

    _LVP_OFF EQU H'3F7F' ; RB4/PGM pin has digital I/O function, HV on MCLR must be used for programming
    _LVP_ON EQU H'3FFF' ; RB4/PGM pin has PGM function, low-voltage programming enabled

    _CPD_ON EQU H'3EFF' ; Data memory code protected
    DATA_CP_ON EQU H'3EFF' ; Data memory code protected
    _CPD_OFF EQU H'3FFF' ; Data memory code protection off
    DATA_CP_OFF EQU H'3FFF' ; Data memory code protection off

    _CP_ALL EQU H'03FF' ; 0000h-07FFh code protected
    _CP_75 EQU H'17FF' ; 0200h-07FFh code protected
    _CP_50 EQU H'2BFF' ; 0400h-07FFh code protected
    _CP_OFF EQU H'3FFF' ; Program memory code 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'

    LIST
    All what you are looking for is here ... with the right spelling !

    ah ... take care to check it for every processor you use as options spelling is not always consistent from a chip to another ...
    ( a Microchip specialty ... )

    Moreover ... I strongly suggest to you to update MPLAB to the last available version ...
    http://ww1.microchip.com/downloads/e...B_IDE_8_92.zip

    so your Pickit2 ...
    http://www.microchip.com/stellent/id...cName=en023805

    Alain
    Last edited by Acetronics2; - 14th October 2013 at 15:01.

  5. #5
    Join Date
    Aug 2003
    Posts
    985


    Did you find this post helpful? Yes | No

    Default Re: MPLAB Configuration

    Thanks, I will take a look
    Using the old software is just to make sure nothing breaks old projects. Some are ten years old.
    If PBP was updated so that a command uses more or less code, and I know that it has,
    that might screw me into working on old programs just to fix them.
    I think it would be mainly where org and lookup tables are used,
    or the program wasn't entirely PBP.

    But since I've got backup operating system drives, there's no excuse not to try.
    I'm working more with hard drive backups now.. op systems with software installed.
    This seems practical since my last PC I used for nine years to the month!







    Quote Originally Posted by Acetronics2 View Post
    Ok, Art

    PM did not call the config options as MPASM does ...

    so, what to do ???

    Open the .inc file corresponding to your processor in the MPASM folder ...

    here: C:\Program Files\Microchip\MPASM Suite

    example for 16F628 ...

    at the bottom of the file, you see :


    All what you are looking for is here ... with the right spelling !

    ah ... take care to check it for every processor you use as options spelling is not always consistent from a chip to another ...
    ( a Microchip specialty ... )

    Moreover ... I strongly suggest to you to update MPLAB to the last available version ...
    http://ww1.microchip.com/downloads/e...B_IDE_8_92.zip

    so your Pickit2 ...
    http://www.microchip.com/stellent/id...cName=en023805

    Alain

Similar Threads

  1. Replies: 6
    Last Post: - 29th December 2011, 21:39
  2. Configuration of 18F268x
    By Mike2545 in forum General
    Replies: 6
    Last Post: - 2nd October 2011, 18:02
  3. 16F726 configuration
    By Byte_Butcher in forum General
    Replies: 2
    Last Post: - 8th February 2009, 17:53
  4. Configuration...again...?
    By Ruben Pena in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 27th September 2008, 23:44
  5. Configuration bits
    By Perrin` in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 3rd July 2008, 14:40

Members who have read this thread : 1

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