-1
\$\begingroup\$

I am trying to write a program for PIC18LF14K50 using MPLAB X and XC8 compiler. So far everything was working fine, but as soon as I set RC3 (input) to 0 and go back to 1, the pic goes into a frozen mode and wont work until I set RC3 to 0 again. The same code was working perfectly fine when written under MikroC.

I have even tried disabling MCLR bit, disabling watch dog, using MCC to generate the code for me, all to no avail.

My only guess is that the pin has been mapped to MCLR but the programmer is working perfectly fine while programming.

the problem persists with/without the programmer connected.

thanks for the help!

\$\endgroup\$
3
  • 1
    \$\begingroup\$ If it was MCLR causing the issue, then it shouldn't work when the pin is low, it should only work as long as the pin is high. The issue is likely elsewhere. Show us your code and a schematic. \$\endgroup\$
    – Klas-Kenny
    Commented Jan 9, 2022 at 13:17
  • \$\begingroup\$ Check config after compilation. Problem may be from eternal libraries, you are using. \$\endgroup\$
    – user263983
    Commented Jan 9, 2022 at 14:11
  • 2
    \$\begingroup\$ RC3 and MCLR have nothing in common. However, RC3 is multiplexed with the PGM 'low-voltage ICSP program-enable' function. Have you forgotten to disable low-voltage programming support? \$\endgroup\$
    – brhans
    Commented Jan 9, 2022 at 14:47

1 Answer 1

1
\$\begingroup\$

Thanks to @brhans , I found the solution after turning off LVP (low voltage programming). The problem was the Single-Supply ICSP and causing the micro to stop working when RC3 was 1.

\$\endgroup\$
1
  • 1
    \$\begingroup\$ K.Azizollahi - Hi, Thanks for adding the answer to your own question. Please remember to come back in a couple of days i.e. no sooner than 48 hours after you asked the question and accept your answer (or another answer, if a better one is added in the meantime). That will effectively close the topic and remove the question from the unanswered list here. Thank you. \$\endgroup\$
    – SamGibson
    Commented Jan 9, 2022 at 21:54

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.