MIDI metronome with ATtiny2313

This MIDI metronome is designed to be connected to a master clock source, allowing you to keep your groove synced to workstations, synths, beatboxes and many more studio gear.

The core is an ATtiny2313 internally clocked at 8MHz, it’s iterfaced to MITI by means of a photocoupler.

MIDI data in carried over a simple half duplex serial stream, 31250 bit/s, 8 data bits, 1 stop bit, no parity: 8N1, thus the internal USART works great with no effort.

The metronome is just counting how many MIDI_CLOCK messages are trasmitted across the line since the MIDI_START message is received. Every 24 MIDI_CLOCKs a quarter note has elapsed.
The microcontroller also contains the routines to generate the audio signal feeded into the headphone amplifier.

In order to minimize battery consumption, the AVR lays in IDLE mode, waking up every time a MIDI message has arrived. IDLE mode stops flash and CPU clock, keeping it running for timers and USART. Atfer a timeout of several minutes, the amplifier is turned off too, by using a transitor, and the AVR falls in deep sleep mode, wake up is triggered only by hardware reset.

Signature: 4/4
Rating: 6V 10mA, less than 0.1mA in deep sleep.

Dowload schematics and source code