Example code for capture series of pulses, using internal timers?
Hello.
Does anyone has some code?
Just want to have look, how it should be done properly.
Re: Example code for capture series of pulses, using internal timers?
Most hardware timers can be setup as counters with external clock input.
Here's a snippet using TMR1 on a 16F88. (Not verified to work but should do so....)
Code:
TRISB.6 = 1 ' T1CKI is on RB6, make sure it's an input
T1CON = %00000111 ' Enable TMR1 as a counter, 1:1 prescale, no sync.
Main:
LCDOUT $FE, 1, "Pulsecount: ", DEC TMR1H*256 + TMR1L
Pause 250
Goto Main
/Henrik.