Hey, i decided to start with PIC programming today and i bought a clone of the pickit 2 with zif socket. My first test was the 12F683 using MicroC Pro and pickit 2 software. Using this code:
void main(void)
{
while(1)
{
GPIO.B2 = 1;
Delay_ms(1000);
GPIO.B2 = 0;
Delay_ms(1000);
}
}
But it does nothing. The code seems to be written fine. Im confused with the MCLR pin and im just using a 100 ohm resistor from the GP2, 5v to VDD and MCLR to 5v. Is this correct? I've tried MCLR to ground with and without resistors
Thanks!
Help with 12F683
Moderator: phalanx
-
- Support Volunteer
- Posts: 2342
- Joined: Fri Jun 15, 2007 9:41 pm
- Location: Eugene, Or
Re: Help with 12F683
MCLR (if that function of the pin is even activated by the fuse settings) should be high, for example connected to Vdd with a 10K resistor.
Did you compile the program and successfully program the chip?
What clock and other fuse settings did you use?
How did you go about determining that "it does nothing"?
Did you compile the program and successfully program the chip?
What clock and other fuse settings did you use?
How did you go about determining that "it does nothing"?
- leon_heller
- Support Volunteer
- Posts: 5734
- Joined: Sun May 01, 2005 11:20 am
- Location: St. Leonards-on-Sea, E. Sussex, UK.
Re: Help with 12F683
Also, you have to set your output pin as an output. The default setting is as an input.
Leon Heller
G1HSM
G1HSM
Re: Help with 12F683
Thanks so much for the replies.
Turns it, i didn't declare the output pins nor the oscilator as interal. Everything is working now!
Thank you!
Turns it, i didn't declare the output pins nor the oscilator as interal. Everything is working now!
Thank you!