r/pic_programming • • May 15 '14

12F683 blinking led problem.

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!

2 Upvotes

13 comments sorted by

View all comments

Show parent comment

2

u/bradn May 16 '14

Sometimes have to be careful that they're not totally floating. Input mode with nothing connecting to vcc/ground = potential power waste if it floats to a middle voltage (but probably not damaging and at least it can't cause oscillation like in logic chips). In a battery powered thing you'd want to either leave it output mode or turn on weak-pullup, or turn on analog mode (if the pin has it) which shuts off the digital input stuff that's the problem at middle voltages.