Getting To Know Every Bit Of An ATtiny13

We recently heard it said of a hacker who pulled off a particularly nice VGA hack on an 8-bit microcontroller: “He knows all the bits, personally.” High praise, indeed. If you want to get on a first-name basis with a ton of transistors, then have a look at [Heinz D]’s Vacation Course in ATtiny13 Assembler (original in German, translated into English by robots here).

But be warned, this isn’t the easy way to learn AVRs. Not content with simply stripping away every layer of abstraction, this month-long “course” in AVR assembly starts off programming the chip initially with just two pushbuttons in its native machine language of high and low voltages. But still, especially if you can get a few assignments done in one sitting, you’re writing in the relative splendor of assembly language and uploading code with a proper programmer before long, because there’s a real limit to how much code one can toggle in before going mad.

There’s a beautiful minimalism to this entirely ground-up approach, and maybe it’s an appropriate starting point for learning how the machine works at its lowest level. At any rate, you’ll be able to lord it over the Arduino crew that you were able to get blink.ino up and running with just a pair of mechanical contacts and a battery. Real programmers

And once you’ve mastered AVR assembly language, you can recycle those two buttons to learn I2C or SPI. What other protocols are there that don’t have prohibitive timeouts? What’s the craziest code that you’ve ever entered bit by bit?

15 thoughts on “Getting To Know Every Bit Of An ATtiny13

  1. This is from 2013 and somewhat outdated(?). The t13 is still a nice µC but Bascom has been replaced by Arduino i think. Also programming the µC with 2 buttons and a LED is a nice exercice but i would not do it, it has little sense in my opinion. Of course its for exercice, but it can be getting frustrating really quick. A real programmer with USB is a few dollars/euros from China. Learning (at least the basics) of ASM is however a really good idea, even today!

      1. An old timer said if I wanted to experience a great feeling I should take a couple of small pebbles and put one in each shoe in the morning and walk around with them all day. At the end of the day take them out. When you take them out oh what a great feeling.

  2. This is great. Hardcore bare metal hacking at its finest. Surprisingly good translation too. The only thing is it seems to be using MOSI as spi input and MISO as output which seems strange.

    I had occasion to use an ATTINY10 which is a miniscule SOT six-pin part. I thought at the time that i could build it into a pen body with coin cells, a LED, and a couple of buttons. I thought i would have to build some kind of interface/language but maybe not – just go right for the metal.

  3. This project has grown out of Burkhard’s Tiny13 programmed via the internet.
    And the Sparrow board shown here in the past
    I could not believe it and tried the Sparrow.tried it it works fine and there is a book about these activities
    Yes it is about minimalism, but even a beginner should be able to use a RPI, Arduino or else to go through these exercises with no button pushed – just keyboard and a little bit of code to simulate the 2 buttons. But the documentation of this weekend project is intriguing That this is possible was really surprising to me.
    OK, the device is rather small, but the same is probably possible using the 20 pin 2313. Then 2k Flash. 2K and useful? Well there is a Forth for it. Another minimalist approach

  4. I’m just trying this with an 8 pin attiny85. I have to use a logic analyzer to watch the responses at first but I’ve successfully put it in programming mode and read the signature bytes 1E 93 0B – very exciting!

    1. I was going to order a tiny13 but stopped when I realized I tossed my box of support discretes during a move. I do still have a logic analyzer and a tube of tiny85s though… Ill take a crack at this tonight

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.