ZBasic has a seductive function called "CountTransitions"
One the face of it it looks ideal for measuring RPM.
"When called, this routine will begin counting logic transitions
on the specified pin and will continue until the specified
interval has elapsed. During the counting process processor
interrupts are disabled. This strategy allows high precision in
measuring the interval but has the drawback that other processes
that utilize interrupts (CAS) will not function correctly. Among such
affected processes are all serial communication and multi-tasking."
The specified interval we are interested in is how long it takes the engine to make
one rev?
Here is another hardware way around this. Use a CD4040. This is a single 16 pin chip
with a 12 bit counter. To review 12 bits gives a resolution of: 8-bits = 256 9-bits
= 512 10-bits = 1024 11-bits = 2048 12-bits = 4096. So the RPM is known to one part
in 4000 in theory. However a cheap watch crystal oscillator only oscillates at 32Khz.
Therefor the resolution varies with RPM. The jpg summarizes the situation.
It takes two parallel 8 bit ports to read the counter and the top second 4 bits can
be used to disable, read and reset the counter.
Paul Lamar
--
The Rotary Engine News Letter. Powered by Linux.
ACRE NL web site.
http://www.rotaryeng.net
You Tube key word PaulLamar2
Copyright 1998-2012 All world wide rights reserved.