Separate fuse configs for each MCU type during programming?


Closed Thread
Results 1 to 6 of 6
  1. #1
    blainecf's Avatar
    blainecf Guest

    Question Separate fuse configs for each MCU type during programming?

    I'm hoping this already exists. (BTW, I read all the readme and help files before posting, so I tried to find the answer before coming here).

    I'm using the USB programmer (love it!).

    However, I'm working on multiple projects that use different MCU models. I need some way to save the fuse configuration for each MCU, so that I don't have to manually change these each time I switch MCU's.

    If no way to save and recall multiple configurations, then any way to embed settings into the code so the programmer can pick them out of the code?

    I wasted an hour yesterday because I switched to a different MCU and had the previous MCU's fuse config.

    SINCERELY,

    bcf

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


    Did you find this post helpful? Yes | No

    Default

    Hi Blaine,

    See this post by Melanie http://www.picbasic.co.uk/forum/show...t=config+fuses
    Regards,

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

  3. #3
    blainecf's Avatar
    blainecf Guest


    Did you find this post helpful? Yes | No

    Talking OK, that and the other referenced articles will educate me thoroughly, but...

    My preliminary look leads me to a simple question: Does the programmer "pick up these settings and burn them once" or will the program re-burn the settings every time it runs.

    This may be ultimately irrelevant, but it seems to me if the fuses were re-burnt every time the program runs, it would be hard on the fuses. But, if the fuses are "made of the same stuff that memory is made of" then it doesn't matter at all.

    Thanks again to all!

  4. #4
    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

  5. #5
    blainecf's Avatar
    blainecf Guest


    Did you find this post helpful? Yes | No

    Default Great! Got it.

    Thanks so much for your help.

  6. #6
    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 : 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