View previous topic :: View next topic |
Author |
Message |
John_Rio
Joined: 22 Jan 2005 Posts: 12 Location: Rio de Janeiro, Brazil
|
Change of pin function if ICD disabled |
Posted: Thu Feb 24, 2005 12:12 pm |
|
|
Hi.
I have a strange little problem.
I have the folloving code in my timer interrupt routine.
IF(milsec++ == 100){decisec++; milsec=0;output_toggle(PIN_B5);}
This works fine when the statement
#device ICD=TRUE
Is used.
I want to remove the ICD=TRUE statement to make the chip read protected, but then the LED stops flashing.
Anybody knows why ?
Device = 18F252 |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Thu Feb 24, 2005 12:39 pm |
|
|
Pin B5 is the PGM pin on the 18F252. I suspect that you forgot to
put NOLVP at the end of your #fuses statement. Without that setting,
the PIC will be left in Low Voltage Programming mode, and will then
lock up if pin B5 goes high. |
|
|
John_Rio
Joined: 22 Jan 2005 Posts: 12 Location: Rio de Janeiro, Brazil
|
Thanks. |
Posted: Thu Feb 24, 2005 12:58 pm |
|
|
That did it.
I was not aware of that.
Once again thanks. |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Thu Feb 24, 2005 1:12 pm |
|
|
This one problem with LVP vs. NOLVP has probably cost the entire
PIC engineering/student community 100,000 hours. (Let's say every
student or engineer spends 1 hour puzzling over this problem once
in their career.) So for probably one customer who insisted on this
feature, Microchip has cost the entire community tons of time. |
|
|
|