1
\$\begingroup\$

I am very new to PIC programming. I have PIC12F675 and I was just wondering if I need something else than connecting MCLR to VDD for it to work. As I understand extra components are not necessary for it?

For start I just want to toggle output every second:

void main()
{
     TRISIO = 0;
     while(1)
     {
             GPIO = 0;
             delay_ms(1000);
             GPIO = 1;
             delay_ms(1000);
     }
}

In mikroC I use these parameters: enter image description here

For uploading hex I use K150 programmer. I read the MCU memory and it seems uploading works. Then I put it on breadboard with 10kOhm resistor (MCLR->VDD).

When I connect 5.26V to it, it uses ~130uA for ~5s and then stays stable at 40uA. I do not notice any output voltage changes on any GPIO (check with voltmeter-multimeter). What am I doing wrong?

Here are the oscillator choices: enter image description here

\$\endgroup\$

1 Answer 1

2
\$\begingroup\$

You have selected an RC oscillator as the clock source, but have not connected one, so the PIC has no clock and therefore will not run.

\$\endgroup\$
7
  • 2
    \$\begingroup\$ Which one should I choose? INTOSC? \$\endgroup\$
    – Ri Di
    Commented May 21, 2023 at 7:22
  • \$\begingroup\$ I don't know what options you have. Selecting an internal oscillator sounds like a good idea. \$\endgroup\$
    – Justme
    Commented May 21, 2023 at 7:25
  • 1
    \$\begingroup\$ So I can use internal without any extra parts, right? \$\endgroup\$
    – Ri Di
    Commented May 21, 2023 at 7:26
  • 1
    \$\begingroup\$ I chose the second - it works! Tahnks. \$\endgroup\$
    – Ri Di
    Commented May 21, 2023 at 7:37
  • 1
    \$\begingroup\$ You might also need to configure the pins from analog to digital I/O, using "ANSEL=0", but apparently it works without this, or perhaps you have not shown all the code. Perhaps MikroC takes care of that automatically. It does differ from MPLABX and XC8, which I use. \$\endgroup\$
    – PStechPaul
    Commented May 21, 2023 at 7:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.