|
|
View previous topic :: View next topic |
Author |
Message |
tobys
Joined: 20 Oct 2009 Posts: 1
|
Student Configuration Fuse Trouble (IESO, FCMEN, INTRC_IO) |
Posted: Tue Oct 20, 2009 7:21 pm |
|
|
I am a student and I am unable to load my PIC-C program onto a PIC18F4331 microcontroller because of a problem with the configuration fuses. How should I program the configuration fuses so that I may load my PIC18F4331 with my program? A snippet of my code that includes the configuration fuses is posted below. When I try to load the program to the chip, and the program is verified, the actual configuration fuses (IESO, FCMEN) are different than what was expected (INTRC_IO). As a result, the program does not run on the microcontroller. An image of the verification result window can be found at
http://www.stanford.edu/~tobys/
Code: |
#include <18f4331.h> // defines the chip being used
#device ADC=16// yes we are using the ICD debugger
#fuses WDT, BROWNOUT, INTRC_IO,
#use delay(clock=8000000)
#define GREEN_LED PIN_A5
#define YELLOW_LED PIN_B4
#define RED_LED PIN_B5
#define PUSH_BUTTON PIN_A4
#use rs232 (baud=9600, xmit=PIN_C6, rcv=PIN_C7)
|
There is a minimal amount of external circuitry associated with my PIC18F4331. I have a 0.1uF capacitor connected to Vdd. The circuit is powered through a 5V supply. I do not have an external oscillator and I want to use the controller’s internal oscillator. I am using ICD (In-Circuit Debugger) Control Program V2.36, CCS 2.73, Compiler Version 3.231, and ICD-U40.
A similar version of the program has successfully been used on a PIC18F452 development kit. The PIC4331 chip is detected by the ICD control program. Any help that you could give would be greatly appreciated. Thank you for your time. |
|
|
bkamen
Joined: 07 Jan 2004 Posts: 1615 Location: Central Illinois, USA
|
Re: Student Configuration Fuse Trouble (IESO, FCMEN, INTRC_I |
Posted: Wed Oct 21, 2009 6:07 am |
|
|
tobys wrote: |
Code: |
#include <18f4331.h> // defines the chip being used
#device ADC=16// yes we are using the ICD debugger
#fuses WDT, BROWNOUT, INTRC_IO,
#use delay(clock=8000000)
|
|
Some quick notes, your FUSES look ok - but maybe for additional compiler clarity, consider changing the clock line to:
Code: | #use delay(clock=8M, INT=8M) |
I just used the M for MHz shorthand as I'm used to it, but more importantly, tell the compiler the default clock speed is 8Mhz AND that you want it to come from the internal oscillator.
also, look at the help for your ADC setting. Are you sure that's what you want or do you want results listed as 0-0x3FF ??
-Ben
BTW, try using NOFCMEN and NOEISO until you get it working and then carefully read up on those fuses and what they do before turning them back on. _________________ Dazed and confused? I don't think so. Just "plain lost" will do. :D |
|
|
|
|
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
|