CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

PIC16F628A with PICDemo 2 Plus Board

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Tue Aug 23, 2005 2:40 pm     Reply with quote

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








PostPosted: Tue Aug 23, 2005 2:56 pm     Reply with quote

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

View user's profile Send private message

PostPosted: Tue Aug 23, 2005 3:15 pm     Reply with quote

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

View user's profile Send private message Send e-mail Yahoo Messenger

PostPosted: Tue Aug 23, 2005 4:04 pm     Reply with quote

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
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
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