CuriousOne
- 9th March 2013, 05:39
Hello.
Does anyone has some code?
Just want to have look, how it should be done properly.
HenrikOlsson
- 9th March 2013, 07:10
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....)
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.
Powered by vBulletin® Version 4.1.7 Copyright © 2025 vBulletin Solutions, Inc. All rights reserved.