The project involves building a frequency meter for gasoline generators using an ATtiny13 microcontroller. The device measures sinusoidal voltage frequencies between 40 and 70 Hz with an accuracy of approximately ±0.1 Hz, despite significant noise and distortion.
The system implements several concurrent processes on a single 8-bit timer: dynamic display on a 74HC164 shift register, a 2-stage IIR filter for signal smoothing, zero-crossing approximation, and frequency calculation based on 32 measurements.
To address temperature instability of the internal RC oscillator, the developer implemented two solutions: switching to an external crystal oscillator and integrating a DS18B20 temperature sensor for frequency calibration via the OSCCAL register.
The software was written in assembly language to fit within the 1 KB memory limit. The system uses a timer-driven approach where ADC conversions are triggered by timer overflows, and the DS18B20 communication is managed via an asynchronous state machine.
The developer utilized SimulIDE for simulation, noting architectural differences between the simulator and actual AVR hardware regarding register buffering. To handle these discrepancies, a conditional compilation variable was introduced for debugging.






