|
|
View previous topic :: View next topic |
Author |
Message |
maikelmeyers Guest
|
false configuration bits |
Posted: Wed Jan 10, 2007 9:56 am |
|
|
Hi,
I have the following problem. Iam using CCS compiler with MPLAB IDE. Everytime I compile my project all configuration bits were reset and the use of the #FUSES directive does'nt influence the configuration bits setting. What should I do? I can't set the bits everytime after I've compiled the project.
Thanks for your help |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
|
Guest
|
|
Posted: Wed Jan 10, 2007 12:50 pm |
|
|
Sorry, it does'nt help
I have
MPLAB V7.5
PCH V4.018
PIC18F4520 (PICDEM 2 PLUS Demo Board)
always after compile my configuration bits settings are lost, also when I don't use any #FUSE directives :( |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Wed Jan 10, 2007 1:36 pm |
|
|
I can't make it fail. I tested PCH vs. 4.018 on two systems:
Win98SE, MPLAB vs. 7.20
Win2K SP4, MPLAB vs. 7.50
It worked fine on both systems.
I compiled the following program, then I went to the Configure/
Configuration Bits menu and compared the Config bits to the fuses.
They were the same.
In the Project/ Build Options menu, I use these settings:
List File: Normal CCS Format
Debug: COFF format
Other Files: Call Tree, Symbol File
I don't know what to recommend except maybe re-install the compiler
and the CCS "plug-in". Get the latest version of the plug-in from the
CCS website.
Code: |
#include <18F4520.h>
#fuses XT, NOWDT, PUT, BROWNOUT, NOLVP
#use delay(clock=4000000)
//#use rs232(baud=9600, xmit=PIN_C6, rcv=PIN_C7, ERRORS)
//============================
void main()
{
while(1);
} |
|
|
|
Guest
|
|
Posted: Wed Jan 10, 2007 3:00 pm |
|
|
I think i found the problem with your help. I thougt, when you don't use any #fuses directive, then the configuration bits keep unchanged. But that is not so. In your example: cancel the XT, then the osc is set back to EXT RC... after compile.
And also I tried all the time to enable the watchdog, but you can't enable the watchdog, when your compiler is set for ICD Debug Mode. Oh, that all confuses a little.
Also it would be better, when the #fuses directive were in the same style like the __config directive in MPASM, because now I have to know all of these keywords:
LP,XT,HS,RC,EC,EC_IO,H4,RC_IO,PROTECT,NOPROTECT,BROWNOUT_NOSL,BROWNOUT_SW,NOBROWNOUT,BROWNOUT,WDT1,WDT2,WDT4
WDT8,WDT16,WDT32,WDT64,WDT128,WDT,NOWDT,BORV25,BORV27,BORV42
BORV45,PUT,NOPUT,CPD,NOCPD,NOSTVREN,STVREN,NODEBUG,DEBUG
NOLVP,LVP,WRT,NOWRT,WRTD,NOWRTD,IESO,NOIESO,FCMEN,NOFCMEN
PBADEN,NOPBADEN,CCP2B3,CCP2C1,WRTC,NOWRTC,WRTB,NOWRTB,EBTR
NOEBTR,EBTRB,NOEBTRB,CPB,NOCPB,LPT1OSC,NOLPT1OSC,MCLR,NOMCLR
WDT4096,WDT8192,WDT16384,WDT32768
and there is no description of them in the manual. |
|
|
Ttelmah Guest
|
|
Posted: Wed Jan 10, 2007 3:21 pm |
|
|
The description, is is 'fuses.txt', in the compiler home directory.
It is not in the manual, because it changes with each new chip, and has to be updated rather more often than the manual. The list of supported fuses for a chip, is in it's header (.h) file.
Best Wishes |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Wed Jan 10, 2007 3:23 pm |
|
|
You don't really need to know all those fuse settings, just the important
ones. This thread has some explanations:
http://www.ccsinfo.com/forum/viewtopic.php?t=24336
The default state for most fuses will be a safe (or disabled) state.
You can see the default state of the Config bits in this table in the
18F4520 data sheet (Page 251 in the Acrobat reader):
TABLE 23-1: CONFIGURATION BITS AND DEVICE IDs
The fuses settings that you should always specify are:
1. Oscillator type
2. Watchdog timer on/off
3. NOLVP (to disable low voltage programming)
4. Brownout on/off
And maybe a few others, such as the NOPBADEN and the PUT fuses. |
|
|
Guest
|
|
Posted: Thu Jan 11, 2007 4:08 am |
|
|
Sorry, I did'nt find any fuses.txt.
But I think, it would still be easier for me to have a __config like directive, because I could do the settings in the configuration bits window in MPLAB and after finishing the project take the configuration byte values and put it in the source (the same work flow like with MPASM). Or you could create the configuration bytes manually with a look in the datasheet.
Thanks very much for your help |
|
|
Ttelmah Guest
|
|
Posted: Thu Jan 11, 2007 4:26 pm |
|
|
You can put them in manually, if you want, with a #ROM definition. The high level version, is more portable, if using multiple chips.
Best Wishes |
|
|
|
|
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
|