View previous topic :: View next topic |
Author |
Message |
PFUM
Joined: 17 Feb 2012 Posts: 2 Location: France
|
10F222 and PICKit 2 : Don't program the PIC |
Posted: Thu Feb 23, 2012 10:31 am |
|
|
Hi to all,
I can't program a PIC 10F222 with the PICKit 2. The program is very simple, it makes just a led flash.
I believe that it is in technical trick.
My HW is very simple.
Only one led pin GP2 and One led pin GP3. Put Pull-Up (4k7) on the pin 8.
My little board is connected by the 6 points connector of the PicKit 2.
The program is generated with CCS last version. Thank you for your help because I found nothing on the forum about this problem.
Best regards.
The C Code by CCS :
Code: |
#include <main-new-10F222.h>
void main()
{
//Example blinking LED program
while(true)
{
output_low(LED);
delay_ms(DELAY);
output_high(LED);
delay_ms(DELAY);
}
}
|
Code: |
#include <10F222.h>
#device adc=8
#FUSES NOWDT //No Watch Dog Timer
#FUSES
#use delay(clock=8000000)
#define LED PIN_B2
#define DELAY 1000 |
|
|
|
temtronic
Joined: 01 Jul 2010 Posts: 9226 Location: Greensville,Ontario
|
|
Posted: Thu Feb 23, 2012 1:33 pm |
|
|
What is the source for the 8,000,000 Hz clock ?
You have not chosen one according to your FUSES options.
Also are you saying the PICkit doesn't program the PIC or that the PIC doesn't run your program the way you think it should ??? |
|
|
PFUM
Joined: 17 Feb 2012 Posts: 2 Location: France
|
|
Posted: Thu Feb 23, 2012 1:46 pm |
|
|
I use internal clock.
Ok for the definition of the fuses, but i don't define with ccs this fuses.
Could you indicate me the typical fuses configuration?
Thanks for your help. |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Thu Feb 23, 2012 2:41 pm |
|
|
Use the forum's search page:
http://www.ccsinfo.com/forum/search.php
Do a search for 10F222. You will find several demonstration programs.
Most of them are from me. They will show you how to setup the #fuses
and anything else you need for that PIC. |
|
|
|