When topping a pint of Guinness this St. Patrick's Day, bartenders of the highest caliber will pour beer into a glass, leaving four inches from the top. It is said they wait 119.5 seconds, then exact the "top up," adding the Shamrock on the head, and waiting another 119.5 seconds for the vicar's collar: one inch of head. That's a perfect pint!
For the unskilled, Maxim's engineers have come up with a system that includes a simple timer circuit to display a decrementing count from 119.5 seconds. It sounds a buzzer when the count reaches zero. A PIC microcontroller updates the display once per second via Port A, the serial interface, and a serially addressable LED driver (IC3) is also on board. The microcontroller is clocked by a 32.768-kHz watch crystal to ensure precise timing.
The IC3 is designed for a serial protocol per the Serial Peripheral Interface standard (SPI). The microcontroller does not require a dedicated SPI port because the SPI routine is written in software. This code uses subroutines to speed any debugging. For the registers internal to IC2 and IC3, all "don't care" states are set to zero. The values written to these registers can be binary format or decimal.
For reliable operation, a supervisory IC with 2-second timeout (IC1) ensures that the 5-V rail is stable on initial power up, before the microcontroller begins its initialization routine. The 5-V rail should be heavily decoupled, using a 220-microfarads capacitor close to IC2 and, for local decoupling, a 1-microfarads tantalum capacitor close to IC3. Two 15-picofarad decoupling capacitors close to the crystal ensure reliable startup of the PIC's internal oscillator. To minimize EMC emission, there are short trace lengths near the crystal and short connections to the LEDs.