View previous topic :: View next topic |
Author |
Message |
jeniffer Guest
|
simple problem.. |
Posted: Thu Oct 09, 2008 9:21 am |
|
|
Hi
I was migrating from pic16f690 to pic16f88.
I wrote this simple program and the led turn 'on' and stay 'on' without blinking... after a while turns off .......why is that?
I don't know something about this pic ?????
Code: | #include <16F88.h>
#fuses XT,NOWDT,NOPROTECT,put
#use delay(clock=8000000)
void main() {
WHILE(1)
{
OUTPUT_HIGH(PIN_B1);
DELAY_MS(500);
OUTPUT_LOW(PIN_B1);
DELAY_MS(500);
}
} |
|
|
|
rnielsen
Joined: 23 Sep 2003 Posts: 852 Location: Utah
|
|
Posted: Thu Oct 09, 2008 9:52 am |
|
|
Quote: | #fuses XT,NOWDT,NOPROTECT,put |
You need to use HS instead of XT in your FUSES statement. |
|
|
JENIFFER Guest
|
|
Posted: Thu Oct 09, 2008 11:14 am |
|
|
Tried this - its not working !
led is stay ON and not blink..
anyone ??
thanx. |
|
|
rnielsen
Joined: 23 Sep 2003 Posts: 852 Location: Utah
|
|
Posted: Thu Oct 09, 2008 11:58 am |
|
|
I assume (we all know what that means) that you are aware that the two PICs are of different pinout sizes. Make sure you have changed the VCC & VSS to match the new part. Make sure you have the spec. sheet and have all of your connections done properly.
If you are using a crystal oscillator, try the following fuses:
HS, NOWDT, PUT, NOMCLR, NOBROWNOUT, NOLVP, NOCPD, NODEBUG, NOPROTECT, NOFCMEN
Some of the fuse statements really aren't necessary but I put them in to make sure. You really don't give much information. See if this will help you get started.
Ronald |
|
|
jeniffer Guest
|
|
Posted: Thu Oct 09, 2008 12:12 pm |
|
|
i dont use crystal , i have checked all pins and they are good.
when i program the PGM pin is connected to ground with 700ohm resistor.
all other pins connected to PICKIT2 as well.(power from usb ).
do i have to disconnect the PGM from ground after programming?
the pickit says that programming succes-does he really knows that program is setting good at the chip ?
the relevant led is turned ON but cant turned off...
thanx. |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
|
jeniffer Guest
|
|
Posted: Thu Oct 09, 2008 2:28 pm |
|
|
Thanx ! working !
but why is that? how can i know the fuses in each case ?? |
|
|
ckielstra
Joined: 18 Mar 2004 Posts: 3680 Location: The Netherlands
|
|
Posted: Thu Oct 09, 2008 2:44 pm |
|
|
Read the datasheet for your PIC. In the oscillator section all possible setup configurations are discussed including the required fuses. Sometimes CCS uses different names for the fuses, see the top of the header file for your chip for all supported fuse names.
A short explanation of the fuse names can be found in the file fuses.txt supplied with the Windows versions of the compiler. |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Thu Oct 09, 2008 2:45 pm |
|
|
Look in this directory to see if you have the Fuses.txt file. It lists all the
fuses and explains each one briefly. You only get the Fuses.txt file if
you have the full IDE compiler (PCW, PCWH, or PCWHD).
Quote: | c:\Program Files\PICC |
If you don't have the Fuses.txt file, then look at this thread.
It lists some of the fuses.
http://www.ccsinfo.com/forum/viewtopic.php?t=31698 |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Thu Oct 09, 2008 4:05 pm |
|
|
If you don't have the Fuses.txt file, someone has posted it in
another forum. It's near the end of this page:
http://www.todopic.com.ar/foros/index.php?topic=16947.0
I think it also comes with the CCS Demo, because that has
the full IDE compiler in it. |
|
|
asmboy
Joined: 20 Nov 2007 Posts: 2128 Location: albany ny
|
i use the F887 for many prods- here is the fuse you want |
Posted: Thu Oct 09, 2008 6:22 pm |
|
|
if using internal osc
you want
#FUSES INTRC, and so on
for the F887
a common statement i use to get ALL I/O freed up and do develepment of nonprotected code programs is
#FUSES NOPROTECT, INTRC,NOWDT,NOMCLR, NODEBUG,NOLVP,NOIESO,NOFCMEN, PUT,NOWRT,NOFCMEN,NOBROWNOUT,
FOR SURE NOT XT - thats |
|
|
jenniffer Guest
|
|
Posted: Sat Oct 11, 2008 6:25 am |
|
|
thank you all.
i found the txt file but i never see the fuses in datasheets. never.
you really helped me each one of you.
thanx. |
|
|
|