thekyguy11
New Member
Mike, you are the man!!! I'll have to play around with it tomorrow to see if I can get it to work. How did you connect the input to the Junebug? Did you use any capacitors or resistors? Which pin? Thanks again!!!!!!!
Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
Mike, the other way to do it with out fancier tricks is to run the CPU off of a watch crystal. Well maybe not that low but, throttle down the operating frequency to make the low end input.You can vary the variable RPM to fit your requirements but it can't be less than 240 without modifying the code. It will also need modifying if you use a faster clock speed than 8MHz.
Have fun.
Mike.
It is pretty straight forward actually. If you run your code on a 4MHz crystal it will report twice the speed since the timebase is now half the frequency.Unfortunately, I don't have an engine available to test it with and so I used a signal generator connected to PortB,0 which is pin 8.
Mike.
Pommie,Ubergeek,
Unfortunately, I missed your earlier post and was replying to the OP.
However, I made a few assumptions in my code,
The OP would want to use a reasonable instruction time as he has a lot of other stuff to do.
And, that I would get 1 pulse per rev. I.E 60 RPM/Hz.
My concern was that should the OP use a higher clock speed then the variable previous would no longer fit in the 16 bits it was allocated.
Mike.