Jerry-Hat-Trick
- Joined Aug 31, 2022
- 840
I’m fairly sure the ATtiny85 with a clock speed of 8MHz will do the job. The signal from the distributor will cause an interrupt and at 600 RPM that’s 50mS between pulses, 5mS at 6000 RPM. After each pulse, probably 2mS debounce time. Use just integer arithmetic. Possibly at higher RPM you could choose not to update the output every pulse. The PWM resolution is 8 bit, so storing 256 values in flash would avoid any need for interpolation. Reading from flash memory takes 3 clock cycles.
My suggestion is to build a minimal version of the hardware to test. Leave out the opto and drive the ATtiny directly from an Arduino UNO. Use a pot to adjust the frequency of 1mS pulses on the UNO and monitor with serial.print. Assume that the meter response is linear so you can test what frequencies actually move the meter to multiples of 100 RPM. This gives you the information you need to populate the lookup table
My suggestion is to build a minimal version of the hardware to test. Leave out the opto and drive the ATtiny directly from an Arduino UNO. Use a pot to adjust the frequency of 1mS pulses on the UNO and monitor with serial.print. Assume that the meter response is linear so you can test what frequencies actually move the meter to multiples of 100 RPM. This gives you the information you need to populate the lookup table


