Separate fuse configs for each MCU type during programming?


Closed Thread
Results 1 to 6 of 6

Hybrid View

  1. #1
    Join Date
    Jul 2003
    Posts
    2,405


    Did you find this post helpful? Yes | No

    Default

    With the MeLabs USB programmer, if you have "Reread File Before Programming" and "Update Configuration From File" selected under the Options menu, then it will reload & program whatever config fuse settings are embedded in your .hex file each time.
    Regards,

    -Bruce
    tech at rentron.com
    http://www.rentron.com

  2. #2
    blainecf's Avatar
    blainecf Guest


    Did you find this post helpful? Yes | No

    Default Great! Got it.

    Thanks so much for your help.

  3. #3
    blainecf's Avatar
    blainecf Guest


    Did you find this post helpful? Yes | No

    Thumbs up For anyone else struggling with this:

    I struggled with this for quite a while; the 18xxxx series works a little different. You can't use the __CONFIG command, and I could never get it to work embedding the @ CONFIG command in the source code (because the include code has some __CONFIG lines in it already, and you CAN'T MIX the two types of config methods, according to the compiler).


    In your program, put this line at the top (according to your processor type!)

    @ #INCLUDE <18F4550.INC>


    Then, edit that include so that it looks like this (customize according to your needs):

    NOLIST
    ifdef PM_USED
    LIST
    "Error: PM does not support this device. Use MPASM."
    NOLIST
    else
    LIST
    LIST p = 18F4550, r = dec, w = -311, f = inhx32
    INCLUDE "P18F4550.INC" ; MPASM Header
    ; NOTE: these are the lines you will add, according to your needs and
    ; the device spec sheet
    ; If there are any __CONFIG lines, delete them!
    CONFIG PLLDIV = 5
    CONFIG CPUDIV = OSC3_PLL4
    CONFIG USBDIV = 2
    CONFIG FOSC = HSPLL_HS
    CONFIG FCMEM = ON
    CONFIG PWRT = ON
    CONFIG BOR = ON
    CONFIG BORV = 43
    CONFIG VREGEN = ON
    CONFIG WDT = OFF
    CONFIG WDTPS = 1024
    CONFIG MCLRE = ON
    CONFIG PBADEN = OFF

    NOLIST
    endif
    LIST

    ... (the rest of the include code)


    I keep each project in it's own folder, then copy the includes needed into that folder.

    Best wishes!

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