Hi all. I'm trying to use hardware timer0 in counter mode on board a 16F74 to measure an external frequency.
I read the pic data sheet, and understand if I set the prescalar to 1:1 and input the signal to RA4/T0CK1 it should work?
I'm looking at the timer function commands, and I figure it should go something like this:
InitTimer0 (Ext, PSO_1/1) ; I'll use 1/2 if necessary and ; double the sample period
Clear timer ; Set to 0
Wait Sampleperiod ; Wait for the count to build up
Ok, now I'm at an impasse. How do I read the value of the register (Called TMRO in the PIC) into a variable so I can use it?
Thanks for any advice,
Chay
In GCBASIC a register is a variable, so you can just use TMR0 like any other variable.
Thanks for the advice.
I found the usage in the online help section.
I should have looked there first!
Log in to post a comment.
Hi all. I'm trying to use hardware timer0 in counter mode on board a 16F74 to measure an external frequency.
I read the pic data sheet, and understand if I set the prescalar to 1:1 and input the signal to RA4/T0CK1 it should work?
I'm looking at the timer function commands, and I figure it should go something like this:
InitTimer0 (Ext, PSO_1/1) ; I'll use 1/2 if necessary and
; double the sample period
Clear timer ; Set to 0
Wait Sampleperiod ; Wait for the count to build up
Ok, now I'm at an impasse. How do I read the value of the register (Called TMRO in the PIC) into a variable so I can use it?
Thanks for any advice,
Chay
In GCBASIC a register is a variable, so you can just use TMR0 like any other variable.
Thanks for the advice.
I found the usage in the online help section.
I should have looked there first!
Chay