View previous topic :: View next topic |
Author |
Message |
pmuldoon
Joined: 26 Sep 2003 Posts: 218 Location: Northern Indiana
|
18f6722 config fuse setting missing |
Posted: Mon Jan 08, 2018 1:38 pm |
|
|
CCS ver 5.074
Does anyone know how to manually set a config fuse in MPLABX?
CCS seems to have left the HSPLL option out of the .h file. With Mplab8 I could set the fuses manually, but with X it gives me sourcecode for the Mplab compiler.
I was trying to speed up an old product and thought I could just replace the 20MHz xtal with a 10MHz and use the 4x PLL. I assumed it was a simple settings change, but not so lucky. The datasheet says the PLL is only available if you set the config appropriately, so I can't change it after the fact with set setup_osc() function.
I was able to make it work by using MPLAB8, but I don't want to have to live in two worlds if I don't have to. I'd rather keep using X.
I will copy CCS on this so maybe they'll fix it in the next release.
Thanks, |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Mon Jan 08, 2018 1:45 pm |
|
|
What about the H4 fuse ? |
|
|
pmuldoon
Joined: 26 Sep 2003 Posts: 218 Location: Northern Indiana
|
|
Posted: Mon Jan 08, 2018 2:50 pm |
|
|
I don't know what you mean by H4 fuse.
The config is addr 300001h. I suppose I could tell the compiler to write a value to that #BYTE address and it should show up in the .hex file, right? I just never thought about it before. If i did that i'd probably have to either write all the config bits or none, otherwise my change would get clobbered by the ccs fuse settings - or visa versa. |
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19590
|
|
Posted: Mon Jan 08, 2018 3:43 pm |
|
|
H4, is the fuse setting for 4x PLL on your chip. The fuse is not 'missing', so you don't need to set the fuse manually.
However you can set fuses directly. Look at the last line of the #fuses entry in the manual "To manually set the fuses in the output files use:". |
|
|
pmuldoon
Joined: 26 Sep 2003 Posts: 218 Location: Northern Indiana
|
|
Posted: Tue Jan 09, 2018 6:25 am |
|
|
Got it! Thanks. I just need to remember to RTFM before panicking. I'm just so used to all the fuse options being there, so it threw me when it wasn't.
And to clarify, the fuse wasn't missing, but the fuse option was definitely missing from the .h file. |
|
|
pmuldoon
Joined: 26 Sep 2003 Posts: 218 Location: Northern Indiana
|
|
Posted: Tue Jan 09, 2018 6:47 am |
|
|
Well, I thought I had it.
Even the example in the book generates a compiler error
Quote: |
#FUSES 1 = 0xC200 // sets config word 1 to 0xC200
Unknown keyword in #FUSES "0XC200"
|
|
|
|
pmuldoon
Joined: 26 Sep 2003 Posts: 218 Location: Northern Indiana
|
|
Posted: Tue Jan 09, 2018 6:54 am |
|
|
Oh nevermind.
The compiler just doesn't like the spaces that the manual shows. remove spaces around the = and it works. |
|
|
pmuldoon
Joined: 26 Sep 2003 Posts: 218 Location: Northern Indiana
|
|
Posted: Wed Jan 10, 2018 6:41 am |
|
|
Funny, I just got a 6-char reply from ccs tech support:
That just seems a little lacking from the people who added all these convenience features to make PIC programming easier.
Okay, I FINALLY figured it out. H4 is a fuse option, and I was thinking in terms of having to set the config reg manually somehow. I just never made the connection since in other chips it was something obvious like, HSPLL or something and has some connection to the datasheet. And since there is no connection to the fuse terms and what bits they actually affect, there was no way to see the connection.
I guess I'm just getting cranky in my old age, LOL. |
|
|
temtronic
Joined: 01 Jul 2010 Posts: 9270 Location: Greensville,Ontario
|
|
Posted: Wed Jan 10, 2018 7:08 am |
|
|
Welcome to the 'club' !
Ever since PICs got more fuses that asm instructions it's been 'fun'. I miss the good old days of READING the datasheet while waiting for the UV eraser to wipe out my silly mistakes !
code-burn-test-oops-erase for 15 MINUTES- repeat...
Jay |
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19590
|
|
Posted: Wed Jan 10, 2018 8:14 am |
|
|
Unfortunately a lot of this is caused by Microchip, changing their minds.
If you get the very first edition data sheet. Guess what MicroChip called the 4xPLL HS oscillator mode?.
This is what CCS based their fuse name on....
It's a pity that when later chips came along calling this HSPLL, CCS didn't update the fuses (and retain H4 for reverse compatibility).
There are still a few of the early PLL chips that refer to H4 in the data sheet.
The key place to look is the processor include file, and I'm puzzled by your comment that you could not find this there:
Quote: |
//////// Fuses: LP,XT,HS,RC,EC,EC_IO,H4,RC_IO,INTRC_IO,INTRC,NOFCMEN,FCMEN
|
|
|
|
pmuldoon
Joined: 26 Sep 2003 Posts: 218 Location: Northern Indiana
|
|
Posted: Wed Jan 10, 2018 8:31 am |
|
|
This forum is my (and CCS's) most valuable tool in solving these problems. You guys confused me, unconfused me, and pushed me to a solution before I even got the autoreply from tech support!
Yes, I lived thru the UV erase cycles. When I was programming in those days i don't think my UV lamp ever turned off, LOL!
And, yes. I saw the H4 in the .h list once I realized it was a fuse option. I was just slow in realizing that's what it was. I thought PCM was playing battleship and sent me the response by accident (yes, I remember that game, too).
And thanks for the history lesson. I guess I never used the PLL back in those days, or just don't remember. I said I was OLD, I never said I was SMART!
Anyhow, thanks for the help, guys. I really appreciate it. |
|
|
|