|
|
View previous topic :: View next topic |
Author |
Message |
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Tue Aug 23, 2005 2:40 pm |
|
|
The following program will blink the LED labeled "RB0" on the PicDem2-
Plus board. Make sure jumper J6 is installed (it's next to the LEDs).
Also note that since the PicDem2-Plus board has an oscillator and
not a crystal, you need to use the EC_IO fuse instead of XT.
Also, in MPLAB vs. 7.20, after you program the PIC, you can release
the board from reset by clicking the button on the MPLAB menu bar
that has an upwards transition symbol on it. Then the LED will start
blinking. Or, you could just unplug the ICD2 cable from the board.
Code: | #include <16F628A.H>
#fuses EC_IO, NOWDT, NOPROTECT, BROWNOUT, PUT, NOLVP
#use delay(clock=4000000)
//========================
void main()
{
while(1)
{
output_high(PIN_B0);
delay_ms(500);
output_low(PIN_B0);
delay_ms(500);
}
} |
|
|
|
Guest
|
|
Posted: Tue Aug 23, 2005 2:56 pm |
|
|
Thanks..
I got it now, even those the config drop down list state that 16f628a
upport debug, but it is not true. It only support as a programmer when use the ICD2.
On demo 2 plus board, have to use the fuse EC.
Thanks again.... |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Tue Aug 23, 2005 3:15 pm |
|
|
If you want debugging capability, go to the 16F88. It's the same package
size, but it can be debugged with ICD2. I tested it just now with the
PicDem2-Plus board and it works with ICD2 in debug mode and in
programmer mode. Here is the test program:
Code: | #include <16F88.h>
#fuses EC_IO,NOWDT,NOPROTECT,PUT,BROWNOUT,NOLVP
#use delay(clock=4000000)
void main()
{
while(1)
{
output_high(PIN_B0);
delay_ms(500);
output_low(PIN_B0);
delay_ms(500);
}
} |
|
|
|
MikeValencia
Joined: 04 Aug 2004 Posts: 238 Location: Chicago
|
|
Posted: Tue Aug 23, 2005 4:04 pm |
|
|
Looks like the question has been solved.
I also had the same problem with the PIC16LF627. Debugging gave an invalid device error, but setting up the icd-2 as a programmer gave no problems.
-Mike |
|
|
|
|
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
|