I use TMR0 as counter to measure the frequency at RA4.
How to get the decimal numbers.
For 135,6 , i take only the 135 from TMR0.I want to take and the ,6 number.
I use TMR0 as counter to measure the frequency at RA4.
How to get the decimal numbers.
For 135,6 , i take only the 135 from TMR0.I want to take and the ,6 number.
Hi Savnik,
Since TMR0 is 8-bit, there is no way you can get 135,6 as you like.
You need to use TMR1 which is 16-bit.
Then, you will read 135,6 at TMR1 register as 1356.
-----------------------------
"If the Earth were a single state, Istanbul would be its capital." Napoleon Bonaparte
Hi, Sayzer
As our friend Savnik didn't tell us which pic he uses ... it's difficult to answer.
let's take the 18F252 i.e.
Timer 0 can be 8 or 16 bits ... as you decide.
Some more details from Savnik could be useful ... but we are used to !!!
Alain
************************************************** ***********************
Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
************************************************** ***********************
IF there is the word "Problem" in your question ...
certainly the answer is " RTFM " or " RTFDataSheet " !!!
*****************************************
Thanks for yours answer.
My default PIC is pic16f88.
Maybe i change with pic18f1330 which have timer0 16bit.
Hi, Savnik
Also could eventually be useful :
the PIC freq.
The Porta.4 max input freq. to be measured
Alain
************************************************** ***********************
Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
************************************************** ***********************
IF there is the word "Problem" in your question ...
certainly the answer is " RTFM " or " RTFDataSheet " !!!
*****************************************
Bookmarks