Blinking led with a PIC

Sep 22, 2006 5 Replies

HI



I am trying to make a led blink. I am using picbasic compiler. I get the program to work and the circuit to work, But it only blinks for a short amount of time, about 20 to 30 seconds. Even if I disconnect the power and replug it do not start again. The circuit is supplied with 5v If I disconnect the power for at least 10 min and then reconnect, then it will start again for about 20 sec.



Also, I download a program done in hex from :

formatting link
and it works fine



here is the code i use: which if found on google on many web sites using pic chip 16F88



loop: High 0 ' Turn on LED connected to PORTB.0 Pause 500 ' Delay for .5 seconds



Low 0 ' Turn off LED connected to PORTB.0 Pause 500 ' Delay for .5 seconds



Goto loop ' Go back to loop and blink LED forever End


ken



i am using a 12v battery (12.89v) with a LM7805 supplying to the circuit. so I am getting 5v. I have a chip that i loaded with a hex file I got on google, compile in jal

formatting link

but i used MicroC and picbasic pro to get my hex file, it blinks only a few times and then stops.

The chips are new, I tryed a few chips and they all do the same thing. excpet the one written in Jal which can blink forever

ken

i would say that your over heating it, or battery supply is dropping on you. or you have a bad PIC chip.

Real Programmers Do things like this. http://webpages.charter.net/jamie_5

Be sure to have a resistor in series with the LED to limit the current to

25mA. 120 or 150 ohms should work. You're probably overheating the device and it is shutting down after awhile then re-starts ok when cool. Bob

I found the problem, had to put a resistor to the MCLR port.. pffff unbelievable

ken

This must be one reason I never use PICs.

Graham

Join the Discussion

Have something to add? Share your thoughts — no account required.

Didn't find your answer?

Ask the community — no account required