heckler73
Well-Known Member
Oh you're using the digital channels? I mostly use the analogs (but I'm trying to read analog voltages in experiments, generally), and any digital work I've done usually hovers around 5Hz at best because the components I play with are slow communicators (like 120-200ms response).The "tone ring" on the alternator rotor (fixed stator) is a 24 segment encoder. I can get practically instant crank speed by checking the interval between pulses on the hall sensor.
The most brief period is 833,000 microseconds at 6000 rpm. I am using the no-scalar, 16mHz clock.
I bit shift a 16 bit register and count each time if overflows. I know how many 62.5 ns, ticks that takes.
The rest is just math. Running this way, I don't have any timing issues in the software loop. The RPM is always available, on the microsecond level. That is way below the real time, of engine lag, and my wrist speed.
Plenty of time.
I'm a little confused by those timings, though. At 100Hz (6000rpm) your smallest cycle is 0.833s ?