hey guys
i'm using mplab and icd2 programmer with my 18f4550. i have got a 20mhz oscillator and want to have 48mhz as output frequency. i have to write some values to the config1h/l registers but i don't know how to do this in c language.
this is what i would like to do:
//CONFIG1L=0x24;
//CONFIG1H=0x0E;
i'm absolutely not keen in asm, so if you have got some asm code, please write copy friendly :_)
regards
Matro Guest
Posted: Mon Apr 07, 2008 6:08 am
This registers, that are called "configuration registers" in the Microchip datasheets are aka "Fuses".
They are set when the device is programmed and are mapped in memory at an address that is not in the program or RAM memory.
To program them with CCS you have to use the preprocessor directive "#FUSES" followed by the fuse(s) you want to set.
If you have PCW you can see the valid fuses in the "view" tab.
Another way to do so is to directly write in ROM at the register address with the "#ROM" directive.
Matro.
Matro Guest
Posted: Mon Apr 07, 2008 6:11 am
Notice that the device you use have the capability of self-writing its configuration registers, using the same way as program memory writing.
For more information, look at the chapter 25.1 of the datasheet (chapter 6.5 for program memory writing).
Matro.
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
Posted: Mon Apr 07, 2008 10:43 am
Quote:
I have got a 20mhz oscillator and want to have 48mhz as output frequency
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum