|
|
View previous topic :: View next topic |
Author |
Message |
gest216 Guest
|
PIC18F44J10 Config bits, How??? |
Posted: Sat Jul 22, 2006 12:08 pm |
|
|
Hi all!
How do one program the configuration bits on the new PIC18F44J10?
The #FUSE way do not work, I tried all kind of odd ways but, NADA.
The only way I had some success is by setting them directly in the ICD2
microchip IDE but that's not the way to go.
What am I doing wrong? Please help.
Many thanks. |
|
|
Ttelmah Guest
|
|
Posted: Sun Jul 23, 2006 3:11 am |
|
|
Unfortunately the current compiler can't place them. CCS are aware of this (I have 'bug reported' it).
The only way to include them in your code at present, is to generate a #ROM statement. Remember the bytes need to be in the top few locations of the program memory space, and the chip automatically copies these bytes during boot to the 'configuration' locations.
The required byte values are correctly generated by the compiler by the fuses (look at the end of the .lst file), but it tries to place them actually 'at' the fuse locations, while on the 'J' chips, this is 'write once RAM', rather than the normal ROM. If you note down these values, and check on the data sheet where they have to go in the program memory for your chip (normally the last eight bytes), and then have:
#ROM PROG_MEM_LOCN = {bytes here for fuses}
These will work.
I am currently using this 'bodge round' for another chip fom the same part of the family (an 87J), so don't know the exact locations for your chip, without going and reading the data sheet.
Best Wishes |
|
|
gest216 Guest
|
It's working , Thanks. |
Posted: Sun Jul 23, 2006 8:00 am |
|
|
The catch was setting the right base address and the right order of bytes :
Code: |
#define CONFIG_BITS_LOCN 0x3FF8
#ROM CONFIG_BITS_LOCN = { 0xA0,0x04,0xC4,0x07,0xF8,0x03 }
// | | | | | + -- CONFIG3H
// | | | | +-------- CONFIG3L
// | | | +------------- CONFIG2H
// | | +------------------ CONFIG2L
// | +----------------------- CONFIG1H
// +---------------------------- CONFIG1L
|
Thanks again. |
|
|
|
|
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
|
Powered by phpBB © 2001, 2005 phpBB Group
|