Thnaks for the ideas mr_e
mackrackit,
I set the pins to analogue after setting them digital, so I don't think that's the problem using ADC.
Thnaks for the ideas mr_e
mackrackit,
I set the pins to analogue after setting them digital, so I don't think that's the problem using ADC.
How, if there's only one interrupt pin (RB0), do the newer pics have more, or is there a trick?Now, I can measure any number of signals simultaneously - on any pin
I'm up to this:
& would like to do a tachometer if it could be done on the same chip.
Maybe a way to cause the input for every pin pulse RB0, and then check the status of other pins..
Last edited by Art; - 30th January 2012 at 16:59.
Comparator Interrupt maybe
Darrel has several if not all setup for ease of use.
http://darreltaylor.com/DT_INTS-14/intro.html
Dave
Always wear safety glasses while programming.
I'm thinking you could connect a signal diode between each pin and RB0 so that a pulse to any pin would also trigger RBO interrupt.
Then in the interrupt service routine go and check which pin has the pulse on it... if it can be done fast enough.
Just got the tachometer working yesterday without any interrupt!
I decided to check the tach signal port in the main loop
just to roughly check the engine is not already running before engaging the starter motor.
I found that a single pulse is counted several times.
Adjusted the check to count only low to high transitions,
and voila! I have my pulse count!!
This would probably be too low res to measure time between pulses, and program adjustments would interfere
with timing so I count the number of pulses over a second for a display that is updated every second.
Not bad for free though![]()
Last edited by Art; - 20th February 2012 at 02:45.
Bookmarks