CONFIGS? setting PIC fuses? Configurations of Hardware settings of a PIC.


Closed Thread
Results 1 to 18 of 18
  1. #1
    Join Date
    Dec 2012
    Location
    Tennessee
    Posts
    262

    Default CONFIGS? setting PIC fuses? Configurations of Hardware settings of a PIC.

    Ok I'm starting this thread to aswer my questions and hopefully this will turn out well enough to become an Article.

    So heres what some of us start with, our first problems when starting with PIC's.
    Usually its not code that causes our first problems, it sometimes is the software that interfaces with our chip to load our HEX file onto the chip. There are so many out there and each one has its own settings and nameing conventions. I blew a dozen chips before realizing I had to set the occilator of the chip up in code or by a drop down setting in the software to use the internal OCC. I didnt have any crystals at the time so I picked PICs that could run without crystals. but I thought that they just worked with my code... little did I know....
    I started out by getting a $25 PIC programmer off eBay, its a K-149 kit. you could get it in a kit or preassembled. I bought the one already built. I hooked it up to the computer and pluged in a chip, dropped the chip selector down and selected my chip. wonderfull it even shows how to place the chip in the ZIF socket. but then hey, im lost it has these things for HEX files, and fuses. and geze im getting confused already, there is no manual for this software that I got, and all the books I had on PICs didnt mention how to run this software.. needless to say I got bored quickly and put off messing with PICs for 2 years. Untill one day I got a project book for PicBasic Pro... WooHoo, it looked just like Basic for the PC, which I knew. I got interested again.. now I had sample programs, and I fumbled through getting a IDE to work, I have mikrobasic, MPIDE, and microcode studio. I settled for the last as it was easiest for me, but everyone is different. so I compiled my first code "led blinky" i beleive this is everyones first... made a HEX file, opened my programmer software, loaded my hex file, and hit program...

    Woo Hoo, no errors and the light blinked... I hit read from chip to make sure.. great its there, took it out pluged it into my breadboard, hooked it up just like the binky article said, and NOTHING HAPPENS... And OUCH.. that chip is HOT.. well that put me off for about another month. However Im a bit stubborn...

    I found that there is a box that says FUSES on my programming software, when I looked it had just a few settings, one called OCC, there it was a setting called XT,HT, RC.. something like that anyways. Well coming from an electronics background, i knew XT usually ment crystal, I didnt know what HT was and from what I read I was confused about RC, I figured that was Realtime Clock... Doh!

    I tryed all the settings but it took 4 chips blowing before I got the Internal clock set right, then Whammo! It worked... I was elated, and my PIC programming was just getting started.

    I was fine using a 12F629 for a little while (I got some samples from microchip, and the programmer came with one) but I had to try others, in comes the 16f629, more pins, about the same as a 16F84 chip with internal clock. so all my books with 84's code shoud work, but a whole new problem. my fuse popup window now has dozens of settings and my clock names are differnt. I blew about 8 more chips before i got worked out to turn WDT off, MCRE off, Brownout off, and set the OCC to internal. and ignore all the other settings.

    Now thats what Ive been doing for the last few years, but its annoying, as everytime I load a hex file all the fuses are reset to default values, so if i program a chip 50 times in a day, even thought its the same chip... I have to change settings of those fuses 50 times.

    NOW ENTER this forum. I browse around, see some good code, see some bad code... and then i see 2 things that interest me, first it looks like the ability to insert ASM code difectly into a pic basic pro code block (but thats for later), and something that looks like this..

    #CONFIG
    __config _CONFIG1, _FOSC_INTOSC & _WDTE_OFF & _PWRTE_OFF & _MCLRE_OFF & _CP_OFF & _CPD_OFF & _BOREN_OFF & _CLKOUTEN_OFF & _IESO_OFF & _FCMEN_OFF
    __config _CONFIG2, _WRT_OFF & _PLLEN_ON & _STVREN_OFF & _BORV_25 & _LVP_OFF
    #ENDCONFIG

    I just copied this from a post today, now that looks like my fuses settings, in some of my links I saved for different projects online they have some of these listed at the top of there code but its not inside a #config they look like this

    __config _CONFIG1, _FOSC_INTOSC & _WDTE_OFF

    which when I tried to include that awhile back only ended up with eerors so i always left that out.

    So now that Ive learned to make "Includes" for some of my code that never changes, I think I would like to tackle adding the Configs. but need a little help. Currently I have over 200 PICs, of about 20 different models, however I have gotten used to using just 2 as my main chips, a 12F683 (ADC+PWM in a 8pin pack), and a 18F4550 (cause its a hoss, just about every option available). I do use others from time to time but these 2 are favorites. I dont understand the _config_config1 and the _config_config2 is this just incremented to continue adding configs, or is there a limit to how many items a config1 can hold, where do I get a list of the configs at do i have to have all the configs listed or can I just do a couple and leave the rest? is there a list somewhere and there definitions? I am lost on setting up these, I may appear as an idiot but we learn by making mistakes and boy do i like to learn ... hehe.

    I am sure its not that hard to do but I need to stop wateing time trying this or trying that and start getting on to this is the propper way to do it to begin with and this is what each setting means rather than making 2-10 attemts at each setting, or not knowing the spelling of s setting to work. , I am going to instert a picture so that some can see what we run up against for those that code everything or have never seen a fuse page. not sure if anyone hasnt. Ive been doing PICs for 4 years now and up to 2 weeks ago had no help, forums or mentors other than a few articles online and a pic basic pro project book. so please forgive anything that seems idiotic to the readers knowlege.

    Name:  Programmer.png
Views: 2353
Size:  55.3 KB this is the programmer screen, I know it may look like some other software out there, pretty much identicle but this kits software works with the kit, the kit will not work with any other programming software out there. even one that says it supports k149.
    Now to show you the Fuse screen for a 18F4550

    Name:  Fuses.png
Views: 3263
Size:  38.1 KB here is the fuse list when you hit the fuse button on the fisrt screen, please note that this list chages with the type of PIC that you choose. note the red items are what I have to chage each time I want to program a chip. so I load hex file, hit fuses, change fuse settings then hit program. I think my main problem is that the drop downs list the items with actual names not _something_...

    So anyone want to take a crack at explaing #Configs and or offering referances

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


    Did you find this post helpful? Yes | No

    Default Re: CONFIGS? setting PIC fuses? Configurations of Hardware settings of a PIC.

    #CONFIG/#ENDCONFIG is only available in PBP3.
    In another thread, you said you only have PBP 2.60.

    So you are limited to doing __configs the old way.
    Try reading this thread ... http://www.picbasic.co.uk/forum/showthread.php?t=543
    DT

  3. #3
    Join Date
    Dec 2012
    Location
    Tennessee
    Posts
    262


    Did you find this post helpful? Yes | No

    Default Re: CONFIGS? setting PIC fuses? Configurations of Hardware settings of a PIC.

    yes i see that now, ok I read through it but still dont understand
    ;----- CONFIG5L Options
    whats this for
    what is this 5L and 5H
    im lost, i need a breakdown of how these statements are built, are they accessing the chip like a asm statement? I could use an example for the 18f4550 chip and set the WDT, Brouwnout, MCRE, and OCC settings, OCC should be internal. then after the code exaple explain why there that way if they have a special feature like needing to be loaded in a certain address?

    for instance fake code below
    WDT_OFF_F4 (where F4 is a memory address or other setting)

  4. #4
    Join Date
    Dec 2012
    Location
    Tennessee
    Posts
    262


    Did you find this post helpful? Yes | No

    Default Re: CONFIGS? setting PIC fuses? Configurations of Hardware settings of a PIC.

    ok I still would like to know how to midify this in code, but till then i modified my INC file for the 18F4550 to this

    __CONFIG _CONFIG1L, _PLLDIV_5_1L & _CPUDIV_OSC1_PLL2_1L & _USBDIV_2_1L
    __CONFIG _CONFIG1H, _FOSC_HSPLL_HS_1H & _FCMEN_OFF_1H & _IESO_OFF_1H
    __CONFIG _CONFIG2L, _PWRT_OFF_2L & _BOR_OFF_2L & _BORV_3_2L & _VREGEN_ON_2L
    __CONFIG _CONFIG2H, _WDT_OFF_2H & _WDTPS_512_2H
    __CONFIG _CONFIG3H, _CCP2MX_ON_3H & _PBADEN_OFF_3H & _LPT1OSC_OFF_3H & _MCLRE_OFF_3H
    __CONFIG _CONFIG4L, _STVREN_ON_4L & _LVP_OFF_4L & _ICPRT_OFF_4L & _XINST_OFF_4L

    however i dont know what to change to make it use "Internal OSC, HT used by USB"
    it fixed my WDT, MCLRE, and BROWNOUT, but can someone show me what to change for the OSC

  5. #5
    Join Date
    Oct 2005
    Location
    Sweden
    Posts
    3,520


    Did you find this post helpful? Yes | No

    Default Re: CONFIGS? setting PIC fuses? Configurations of Hardware settings of a PIC.

    Hi,
    PBP has a default CONFIG for each chip which is located in the .inc file (in the PBP folder) for the specific chip. If you want to set the CONFIG from within your program you must comment out the default CONFIG in the .inc file. If you leave the default in the .inc file AND put your own in the program you'll get an error because they are then conflicting with each other.

    Note that setting the CONFIG bits is not actually part of the PBP program, it's nothing that gets done when the program runs. It's just a way to embedd them into the .hex file so that you don't have to manually change them in the device programmer software.

    If you look section 25.1 in the datasheet for the 18F4550 you'll see the various CONFIG registers for the device. If you continue to read there's an explenation for each and every bit in each of these registers in the following pages.

    Now, let's take a look at the following line, what does it actually do:
    __CONFIG _CONFIG1L, _PLLDIV_5_1L & _CPUDIV_OSC1_PLL2_1L & _USBDIV_2_1L

    Well, __CONFIG is the assembler directive to tell the assembler that we are setting CONFIG bits. _CONFIG1L is the name of register we are setting and the rest are the actual settings. If you open up the MPASM Suite folder of your MPLAB installation you'll find a bunch of .INC files (note that these are not equivalent to the .inc files in the PBP folder). If you open up the one for the 18F4550 (P18F4550.INC) and scroll down towards the bottom you'll find the definitions for the constants in the above statement:
    Code:
    ;----- CONFIG1L Options --------------------------------------------------
    _PLLDIV_1_1L         EQU  H'F8'    ; No prescale (4 MHz oscillator input drives PLL directly)
    _PLLDIV_2_1L         EQU  H'F9'    ; Divide by 2 (8 MHz oscillator input)
    _PLLDIV_3_1L         EQU  H'FA'    ; Divide by 3 (12 MHz oscillator input)
    _PLLDIV_4_1L         EQU  H'FB'    ; Divide by 4 (16 MHz oscillator input)
    _PLLDIV_5_1L         EQU  H'FC'    ; Divide by 5 (20 MHz oscillator input)
    _PLLDIV_6_1L         EQU  H'FD'    ; Divide by 6 (24 MHz oscillator input)
    _PLLDIV_10_1L        EQU  H'FE'    ; Divide by 10 (40 MHz oscillator input)
    _PLLDIV_12_1L        EQU  H'FF'    ; Divide by 12 (48 MHz oscillator input)
    
    _CPUDIV_OSC1_PLL2_1L EQU  H'E7'    ; [Primary Oscillator Src: /1][96 MHz PLL Src: /2]
    _CPUDIV_OSC2_PLL3_1L EQU  H'EF'    ; [Primary Oscillator Src: /2][96 MHz PLL Src: /3]
    _CPUDIV_OSC3_PLL4_1L EQU  H'F7'    ; [Primary Oscillator Src: /3][96 MHz PLL Src: /4]
    _CPUDIV_OSC4_PLL6_1L EQU  H'FF'    ; [Primary Oscillator Src: /4][96 MHz PLL Src: /6]
    
    _USBDIV_1_1L         EQU  H'DF'    ; USB clock source comes directly from the primary oscillator block with no postscale
    _USBDIV_2_1L         EQU  H'FF'    ; USB clock source comes from the 96 MHz PLL divided by 2
    So, _PLLDIV_5_1L equals FC, _CPUDIV_OSC1_PLL2_1L equals E7 and _USBDIV_2_1L equals FF. If we AND those together, which is what the statement does, we get E4 or 11100100 in binary. Now go back to the datasheet and put those ones and zeros into the CONFIG1L register.

    Bits 2-0 are the PLL prescaler bits, they are being set to 100 which means divide by 5 (20MHz oscillator input). This matches nicely with the named constant _PLLDIV_5_1L
    Bits 4-3 are the System Clock Postscaler selection bits. These means different things depending on another setting but when used with the PLL and set to 00 the divider is set to 2 for a system clock of 96MHz/2=48Mhz. Again the named constant _CPUDIV_OSC1_PLL2_1L matches the what's actually happening.
    Bit 5 is the USB Clock Selection bit, we're setting it to 1 which means USB clock source comes from the 96 MHz PLL divided by 2 which again matches the named constant _USBDIV_2_1L

    And it's the same for all the other CONFIG registers. Just remember that this is just a way to tell the assembler what to embedd in the .hex file so that the device programmer can program the correct the CONFIG bits into the device without having the user set them in the software for the device programmer. It's not the same as doing something like T1CON = %00010010 which actually executes at runtime.

    I hope this sheds some more light on the subject and that I'm not too far from the truth, in which case I'm sure someone will jump in and correct me.

    /Henrik.
    Last edited by HenrikOlsson; - 4th January 2013 at 10:15.

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


    Did you find this post helpful? Yes | No

    Default Re: CONFIGS? setting PIC fuses? Configurations of Hardware settings of a PIC.

    Did you read the thread that Darrel linked you to? It even talks about the 18F2550 which is pretty much the same as the 4550... they do share the same data sheet.


    __CONFIG _CONFIG1H, _FOSC_HSPLL_HS_1H & _FCMEN_OFF_1H & _IESO_OFF_1H

    __CONFIG _CONFIG1H, _FOSC_INTOSC_HS_1H & _FCMEN_OFF_1H & _IESO_OFF_1H

    As the thread said, this information can be found here
    C:\Program Files (x86)\Microchip\MPASM Suite

    From the same file.
    ; Configuration Bits
    ;
    ; NAME Address
    ; CONFIG1L 300000h
    ; CONFIG1H 300001h
    ; CONFIG2L 300002h
    ; CONFIG2H 300003h
    ; CONFIG3H 300005h
    ; CONFIG4L 300006h
    ; CONFIG5L 300008h
    ; CONFIG5H 300009h
    ; CONFIG6L 30000Ah
    ; CONFIG6H 30000Bh
    ; CONFIG7L 30000Ch
    ; CONFIG7H 30000Dh
    Last edited by mackrackit; - 4th January 2013 at 10:25.
    Dave
    Always wear safety glasses while programming.

  7. #7
    Join Date
    Dec 2012
    Location
    Tennessee
    Posts
    262


    Did you find this post helpful? Yes | No

    Default Re: CONFIGS? setting PIC fuses? Configurations of Hardware settings of a PIC.

    OK I think got confused since some code is using the MPASM folder (MPASM Suite folder of your MPLAB installation) and others have just the PBP folder
    I dont have a MPASM Suite folder of my MPLAB installation, cause its not installed. I am just using PBP with Microcode studio.

    ok Henrik's post explains alot, I looked at the datasheet before but didnt understand that section, figured it was part of the assembly language and left it alone. but it makes more sense now. ok based on henriks notes, lets see if this looks right

    default 18f4550.inc has
    __CONFIG _CONFIG1H, _FOSC_HSPLL_HS_1H & _FCMEN_OFF_1H & _IESO_OFF_1H

    so if this is right based on the datasheet, and henriks note then to make it use the internal OSC and USB with HS then it should read
    __CONFIG _CONFIG1H, _FOSC_INTHS_HS_1H & _FCMEN_OFF_1H & _IESO_OFF_1H
    ??? is this correct /or the correct way???

  8. #8
    Join Date
    Dec 2012
    Location
    Tennessee
    Posts
    262


    Did you find this post helpful? Yes | No

    Default Re: CONFIGS? setting PIC fuses? Configurations of Hardware settings of a PIC.

    well I tried that out, got something wrong,
    it says symbol not defined... error on build.
    Last edited by wdmagic; - 4th January 2013 at 11:28.

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


    Did you find this post helpful? Yes | No

    Default Re: CONFIGS? setting PIC fuses? Configurations of Hardware settings of a PIC.

    You have to have MPLAB/MPASM to use the 18FXXX chips. Install the version that you received when you purchased PBP.
    Dave
    Always wear safety glasses while programming.

  10. #10
    Join Date
    Dec 2012
    Location
    Tennessee
    Posts
    262


    Did you find this post helpful? Yes | No

    Default Re: CONFIGS? setting PIC fuses? Configurations of Hardware settings of a PIC.

    ive been using 18 series chips fine without it installed, I dont have my orginal software anymore it and alot of other stuff was lost in a tornado 2 years ago, all ive got is some backup software, I guess i can go and try to find a copy online but as i can program chips now fine i see no reason to. Ive been programming the 18 series chips fine, I have never installed any other software, just microcode studio and PBP, i did install MPLAB and microbasic but when i try to run mplab it gives me a dll error, and im not familiar with microbasic code, i like pbp code better.

  11. #11
    Join Date
    Dec 2012
    Location
    Tennessee
    Posts
    262


    Did you find this post helpful? Yes | No

    Default Re: CONFIGS? setting PIC fuses? Configurations of Hardware settings of a PIC.

    ok i used that _FOSC_INTOSC_HS_1H code from the other article and it works, but I dont get where the INTOSC came from, heres the info strait from the 4550 datasheet

    FOSC3:FOSC0: Oscillator Selection bits(1)
    111x = HS oscillator, PLL enabled (HSPLL)
    110x = HS oscillator (HS)
    1011 = Internal oscillator, HS oscillator used by USB (INTHS)
    1010 = Internal oscillator, XT used by USB (INTXT)
    1001 = Internal oscillator, CLKO function on RA6, EC used by USB (INTCKO)
    1000 = Internal oscillator, port function on RA6, EC used by USB (INTIO)
    0111 = EC oscillator, PLL enabled, CLKO function on RA6 (ECPLL)
    0110 = EC oscillator, PLL enabled, port function on RA6 (ECPIO)
    0101 = EC oscillator, CLKO function on RA6 (EC)
    0100 = EC oscillator, port function on RA6 (ECIO)
    001x = XT oscillator, PLL enabled (XTPLL)
    000x = XT oscillator (XT)

    i figured it should read _FOSC_INTHS_HS_1H but thats not right, so where is it that it shows the INTOSC or where did this come from?

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


    Did you find this post helpful? Yes | No

    Default Re: CONFIGS? setting PIC fuses? Configurations of Hardware settings of a PIC.

    If you read the link that Darrel gave you it tells you to look in the MPASM directory for the *.inc file. All of the config settings are there.

    And you do have to have MPASM installed to use an 18Fxxx chip.
    From the PBP 18F4550.inc
    NOLIST
    ifdef PM_USED
    LIST
    "Error: PM does not support this device. Use MPASM."
    NOLIST
    else
    LIST
    LIST p = 18F4550, r = dec, w = -311, w = -230, f = inhx32
    INCLUDE "P18F4550.INC" ; MPASM Header
    __CONFIG _CONFIG1L, _PLLDIV_5_1L & _CPUDIV_OSC1_PLL2_1L & _USBDIV_2_1L
    __CONFIG _CONFIG1H, _FOSC_HSPLL_HS_1H & _FCMEN_OFF_1H & _IESO_OFF_1H
    __CONFIG _CONFIG2L, _PWRT_OFF_2L & _BOR_ON_2L & _BORV_3_2L & _VREGEN_ON_2L
    __CONFIG _CONFIG2H, _WDT_ON_2H & _WDTPS_512_2H
    __CONFIG _CONFIG3H, _CCP2MX_ON_3H & _PBADEN_OFF_3H & _LPT1OSC_OFF_3H & _MCLRE_ON_3H
    __CONFIG _CONFIG4L, _STVREN_ON_4L & _LVP_OFF_4L & _ICPRT_OFF_4L & _XINST_OFF_4L
    NOLIST
    endif
    LIST
    EEPROM_START EQU 0F00000h
    BLOCK_SIZE EQU 32
    Dave
    Always wear safety glasses while programming.

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


    Did you find this post helpful? Yes | No

    Default Re: CONFIGS? setting PIC fuses? Configurations of Hardware settings of a PIC.

    i did install MPLAB
    So you do have MPASM. It is part of MPLAB.
    Dave
    Always wear safety glasses while programming.

  14. #14
    Join Date
    Oct 2005
    Location
    Sweden
    Posts
    3,520


    Did you find this post helpful? Yes | No

    Default Re: CONFIGS? setting PIC fuses? Configurations of Hardware settings of a PIC.

    There's two steps to going from a PBP program to a .hex file.
    First the PBP program gets compiled (that's what PBP does, it's a compiler and it compiles programs). For this the compiler uses its own device specific .inc file located in the PBP folder. The output of the compiler is basically your program converted into assembly language. This then needs to be run thru an assembler and IT uses it's own device specific .inc file which is located in the MPASM folder. The output of the assembler is your final .hex file that you then program into the PIC.

    If you've noticed the __CONFIG...... are "enclosed" with ASM / ENDASM meaning that it is assembly. PBP doesn't know or care about that - it's directly passed to the assembler and it's the assemblers job to interpret what to do with it.

    Prior to PBP3 the compiler came with its own assembler, called PM but it has never worked for 18-series chips so you MUST have MPASM installed somewhere on your system and you MUST have your IDE (MicroCodeStudio - which is nothing more than a text editor tailored specifically for PBP code really) pointing to the install folder of MPASM - otherwise you wouldn't be able to compile and assemble anything for 18-series devices.

    i figured it should read _FOSC_INTHS_HS_1H but thats not right
    Don't guess. Open the .INC file in the MPASM folder, scroll down to find the options for the CONFIG1H register and it'll TELL you what it the correct names for all the options: _FOSC_INTOSC_HS_1H - if that is the correct one for your application is another question. I've never used USB so I don't know.

    /Henrik.

  15. #15
    Join Date
    Dec 2012
    Location
    Tennessee
    Posts
    262


    Did you find this post helpful? Yes | No

    Default Re: CONFIGS? setting PIC fuses? Configurations of Hardware settings of a PIC.

    ok , now I got it , sorry for being a pain, it is installed but its not in a mpasm folder, its in microchip/MCP Files/mpasm
    I had someone install everything the first time, when i was using version 2.46, when I upgraded i didnt install anything but PBP and microcode studio.
    Im still using the original PC and OS or I would have lost all this. i found the folder since you said microbasic pointed to it, i remember having to set that for the PBP folder so i went back and looked at the other tab and it was different, didnt think to look there to find path, i was just looking in program files for a mpasm folder.theres about 20 M named folders so microchip was far away from mpasm didnt even see it. so thanks. however now im worried cause i dont have my original software for mpasm, will have to try to get a copy online so i have a backup. this pc has its issues sooner or later it will need to be wiped or replaced.
    OK I found the area in the 18F4550.inc in the mpasm folder in the file where it lists the OSC options, thanks. sorry again.
    Ive done some wonders with chips and code but still very basic, I'm getting alot better but now i am wanting to start using alot more of code rather than just the basic stuff so I get confused. I jusmped right in and missed alot of the background reading of why and how things work. since I didnt have help it was needed to keep me interested. now though im making up for it, im reading the books and studying the manual and datasheets, but some things still get me confused.
    I did come up with some code to enable 2 or more PWMs on a 12F683, never seen anyone do that before, but since I didnt have anyone to ask how to do PWMS I had to figure out it all myself. I'm learning alot from the posts here, thanks to all who put up with me. hopefully I can help some others now or later on.

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


    Did you find this post helpful? Yes | No

    Default Re: CONFIGS? setting PIC fuses? Configurations of Hardware settings of a PIC.

    sorry for being a pain
    No problem, that is why we are here, to help each other out.

    If you purchased PBP from MeLabs or one of their dealers, they should be able to find you in their records. Then you can upgrade for a minimal cost. It is worth it.
    Dave
    Always wear safety glasses while programming.

  17. #17
    Join Date
    Dec 2012
    Location
    Tennessee
    Posts
    262


    Did you find this post helpful? Yes | No

    Question Re: CONFIGS? setting PIC fuses? Configurations of Hardware settings of a PIC.

    OK, Found problem with my fuses, not an issue till I decided to try a resonator with my 18F4550

    When I go to set fuses, I only have 4 options, where I should have 12.

    In my MPASM folder INC file for 18F4550

    ;----- CONFIG1H Options --------------------------------------------------
    _FOSC_XT_XT_1H EQU H'F0' ; XT oscillator (XT)
    _FOSC_XTPLL_XT_1H EQU H'F2' ; XT oscillator, PLL enabled (XTPLL)
    _FOSC_ECIO_EC_1H EQU H'F4' ; EC oscillator, port function on RA6 (ECIO)
    _FOSC_EC_EC_1H EQU H'F5' ; EC oscillator, CLKO function on RA6 (EC)
    _FOSC_ECPLLIO_EC_1H EQU H'F6' ; EC oscillator, PLL enabled, port function on RA6 (ECPIO)
    _FOSC_ECPLL_EC_1H EQU H'F7' ; EC oscillator, PLL enabled, CLKO function on RA6 (ECPLL)
    _FOSC_INTOSCIO_EC_1H EQU H'F8' ; Internal oscillator, port function on RA6, EC used by USB (INTIO)
    _FOSC_INTOSC_EC_1H EQU H'F9' ; Internal oscillator, CLKO function on RA6, EC used by USB (INTCKO)
    _FOSC_INTOSC_XT_1H EQU H'FA' ; Internal oscillator, XT used by USB (INTXT)
    _FOSC_INTOSC_HS_1H EQU H'FB' ; Internal oscillator, HS oscillator used by USB (INTHS)
    _FOSC_HS_1H EQU H'FC' ; HS oscillator (HS)
    _FOSC_HSPLL_HS_1H EQU H'FE' ; HS oscillator, PLL enabled (HSPLL)
    in my PBP folder INC for 18F4550

    NOLIST
    ifdef PM_USED
    LIST
    "Error: PM does not support this device. Use MPASM."
    NOLIST
    else
    LIST
    LIST p = 18F4550, r = dec, w = -311, w = -230, f = inhx32
    INCLUDE "P18F4550.INC" ; MPASM Header
    __CONFIG _CONFIG1L, _PLLDIV_5_1L & _CPUDIV_OSC1_PLL2_1L & _USBDIV_2_1L
    __CONFIG _CONFIG1H, _FOSC_INTOSC_HS_1H & _FCMEN_OFF_1H & _IESO_OFF_1H
    __CONFIG _CONFIG2L, _PWRT_OFF_2L & _BOR_OFF_2L & _BORV_3_2L & _VREGEN_ON_2L
    __CONFIG _CONFIG2H, _WDT_OFF_2H & _WDTPS_512_2H
    __CONFIG _CONFIG3H, _CCP2MX_ON_3H & _PBADEN_OFF_3H & _LPT1OSC_OFF_3H & _MCLRE_OFF_3H
    __CONFIG _CONFIG4L, _STVREN_ON_4L & _LVP_OFF_4L & _ICPRT_OFF_4L & _XINST_OFF_4L
    NOLIST
    endif
    LIST
    EEPROM_START EQU 0F00000h
    BLOCK_SIZE EQU 32
    However in my programmer it only shows 4 options for OSC settings

    HS OSC with PLL, HS used by USB
    HS OSC, HS used by USB
    INT OSC, HS used by USB <-- Default Selected Item See the INC file in PBP
    INT OSC, XT used by USB
    How do I get it to show me XT's and the other missing items in my list so I can select XT to use with my resonator?

    ADD ON NOTE:

    in my programmer software it has the list of chips in a file , here the line from the 4550 chip for defineing the OSC options

    LIST5 FUSE1 "Oscillator" "HS OSC w/PLL, HS used by USB"=FFFF "HS osc, HS used by USB"=FCFF "Intrn osc, HS used by USB"=FBFF "Intrn osc, XT used by USB"=FAFF
    as you can see it only shows 4 items, so i'm guessing thats why i only have 4.

    now on the same file the 4480 uses this line

    "LP Osc"=F0FF "XT Osc"=F1FF "HS Osc"=F2FF "Ext RC"=F3FF "EC Osc"=F4FF "EC Port RA6"=F5FF "HSPLL"=F6FF "Ext RC"=F7FF "Int OSC"=F8FF "Int OSC Clk RA6 PortB"=F9FF "Int Osc Clk RA6"=FBFF "Int Osc Clk RA6"=FCFF
    So question is, what FXXX do I use for adding these in manually, as I figure there not universal to all chips.
    Last edited by wdmagic; - 15th March 2013 at 22:47.

  18. #18
    Join Date
    Dec 2012
    Location
    Tennessee
    Posts
    262


    Did you find this post helpful? Yes | No

    Default Re: CONFIGS? setting PIC fuses? Configurations of Hardware settings of a PIC.

    OK I Think I figured it out

    in my MPASM file
    _FOSC_XT_XT_1H EQU H'F0' ; XT oscillator (XT)
    so I took and figured
    _FOSC_XT_XT_1H EQU H'F0' ; XT oscillator (XT)
    used that with a FF at the end and it seems to work, so I will manually add those other items back into the program.

Similar Threads

  1. IR trasmitter using PIC 16F84 and NE555
    By tonixxx in forum mel PIC BASIC
    Replies: 1
    Last Post: - 27th December 2012, 00:55
  2. How do I program a pic to accept inputs?
    By timbear3 in forum mel PIC BASIC Pro
    Replies: 8
    Last Post: - 2nd December 2012, 00:35
  3. Replies: 7
    Last Post: - 20th November 2012, 19:41
  4. Which pic? up to date basic chip for 16f877
    By tasmod in forum mel PIC BASIC Pro
    Replies: 12
    Last Post: - 19th November 2012, 11:26
  5. How not to prototype your next PIC project
    By SteveB in forum General
    Replies: 3
    Last Post: - 12th November 2012, 09:35

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