I have to program the 16f84 to count input pulses. depending on the amount of pulses depends on what subroutine has to be executed. Can i use the watchdog timer to count input pluses from an input pin while executing a subroutine? Or is there another way to do this?
im using ra4 for my timer. im having to count the time in a subroutine at the same time as counting input pulses for an input pin. if i used this pin to increment a count somewhere else in memory, this will not carry on counting when executing a subroutine will it?
Use the interrupt on RB0 to set and stop counter. After that, you can re-compute the real length of your pulse, because it need 3 cycles to come to the interrupts, and 1 cycles to get back. But you know exactly when it interrupts.
If you count a variable, it can happen that the pulse is falling down as you are counting, you don't know exactly when it is. But with interrupt, you know it.