Re: Help need PIC16F877A
2xling,
What you want to do, if you don't want to use a timer, is to set the output that your LED is connected to, then call a delay. If your delay is, say, one second, then call it five times. Then clear the output, and call the delay again. The problem with this is that your micro spends most of its time in dealy loops, which is alright, if that is all your micro has to do.
If, on the other hand, you have other things to do with the micro, you can have an interrupt which marks off a certain amount of time. In the interrupt routine, you increment a counter variable. In your main code, you compare the value of the variable to a pre calculated number. For example, if your interrupt is set to go off every 100 mSec (ten times a second) then your precalculated number would be 50. After 50 interrupts, five seconds has passed, so change the state of the output.
I hope this helps, if you have any questions, just ask.
Best wishes,
Robert