Carefull when you use reserved word... COUNT is also a PBP statement. You should change it to something else
NowJUST FOR FUN, and as your current hardware is setuped to use it, try this one which use TMR0
Code:ADCON1 = 7 pCount VAR BYTE OldpCount VAR BYTE CLEAR TMR0 = 0 OLDPCOUNT = 1 Start: pCount = TMR0 IF pCount != OldpCount then LCDOUT $FE,$C0, #pCount OldpCount = pCount ENDIF GOTO Start
Last edited by mister_e; - 17th June 2007 at 22:22.
Steve
It's not a bug, it's a random feature.
There's no problem, only learning opportunities.
Thanks for your advice.
I chanced count to sayim(in Turkish)
I do not want to use timer because when disk begin to rotation ( which is slow rotation)micro magnet take to time to pass under the magnetic swich so swich is on position and count is going to count I do not this. I want only one time not elong with passing is going on.
Hi Turkuaz,
Could you tell us what's your MAX RPM ( or half freq ...) counting rate expected ???
Will help for a solution.
I think we could detect only the Low-to-High ( or High-to-Low ) transitions, to get rid of the rotation speed span.
But the debouncing time must fit the max RPM !!!
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