Step 5Using Timer/Counter 0 for Beeps
For the mode we'll use, operation of the Timer/Counter is straight-forward. When a clock signal is selected, the counter starts at zero and increments each clock pulse. When the counter value reaches the value in the Output Compare Register (TOP), the counter resets to zero and counting starts again. The output bit associated with the Timer/Counter is toggled to produce a square wave output. This directly drives an audio transducer to make a beep sound.
A small TDK Audio Transducer produces the beep. A suitable unit is Digikey 445-2530-ND, TDK SD1209T3-A1 (I used an early version of this). This is a 3 volt version; the 5 volt version will also work I expect. I drive this directly off the output port of the Attiny2313 and it seems to work fine. Sparkfun has a similar device.
| « Previous Step | Download PDFView All Steps | Next Step » |
![]() |
Add Comment
|








































