Tiny Tunes On An ATtiny13

When you take a microcontroller class in university, one of the early labs they have you drudge through on your way to, promised, mastery over all things embedded, is a tiny music generator.

It’s a more challenging lab than one would expect. It takes understanding the clock of the microcontroller and its sometimes temperamental nature. It takes a clear mental picture of interrupts, and is likely one of the first experiences a burgeoning designer will have worrying about the execution time of one of their loops. Also tables, data structures, and more. It even requires them to go out of their comfort zone a learn about an unrelated field, a challenge often faced in practicing engineering.

Luckily [Łukasz Podkalicki] has done a great job of documenting the adventure. He’s got everything from the schematic and code to the PWM traces on the oscilloscope.

It’s also worth mentioning that he’s got a few other really nice tutorials for the ATtiny13 microcontroller on his blog. A tiny party light generator and a IR receiver among them.

8 thoughts on “Tiny Tunes On An ATtiny13

  1. Heh yah I remember my first adventure with directly toggling an io pin speaker… Managed a series of farts interspersed with hiccups… Not what I was aiming for. Had in mind a drum and bass sequencer. Couldn’t get it any faster at the time.

    1. My first ‘toggle the pin’ was on a TRS-80 computer (1978) and I was clicking the cassette drive relay on and off with BASIC. I quickly discovered the port address that goes to the tape drive data and then I could make complex sounds with what is called PWM today by using machine code. It was amazingly simple to do compared to my BASIC programs that did things like modeling/synthesis for chemistry.

  2. in the 90′ when I didnt know about microcontrollers/arduinos , I did the music generator with: eprom 27c512, it had the string of 8 bit values according to the tone , at the output of the eprom was a DAC created by resistor ladder r2r, and then a 555 configured as voltage to frequency converter, it played “la cucaracha” and when the “saints go marching in”. now I am spoiled with arduinos and the tone library.

Leave a Reply

Please be kind and respectful to help make the comments section excellent. (Comment Policy)

This site uses Akismet to reduce spam. Learn how your comment data is processed.