A simple program for Pic12F675 is not giving correct result

Thread Starter

pgmetgud

Joined Oct 9, 2018
5
Hi everyone,

I wrote a simple "Blinking L.E.D" program using MikroC and Pic12F675. The L.E.D has to be ON for 4 seconds and then OFF for 4 seconds and this way, it has to keep blinking continuously. For around 2 minutes after switching ON the power supply, the program works correctly. But, after that, the L.E.D remains totally switched OFF. At first, I thought it may be some fault of that particular chip and programmed a second chip. That chip also is showing same problem. After 2 minutes, the L.E.D gets totally switched OFF. The program uses GP1 pin (that's pin number 6)of the Pic12F675. Please can anyone tell me what is the problem?

Thanks in advance,
Prabhu
 

Thread Starter

pgmetgud

Joined Oct 9, 2018
5
You'll need to show the code.... It's almost impossible to guess..
I checked the code once again ........ actually, i had forgotten that i had added a "for(k=20;k>0;k--)" { ..led blink...} loop to the C code ..................now i see that it was my mistake . Now, I found it out. The program is doing exactly what it is supposed to do.
 

peterdeco

Joined Oct 8, 2019
484
I switched to Picbasic Pro a long time ago. For me it was much easier to learn. Your program would simply be:
start:
high gpio.1
pause 4000
low gpio.1
pause 4000
goto start
 
Top