ATtiny Hacks: ATtiny10 game – doing more with less

Okay, you’ve got a six-pin microcontroller with 1k of program memory, 32 bytes of SRAM, and it can’t be programmed using an In-System-Programmer. Do you think you can use it to develop a game? [Wrtlprnft] managed to build a Simon Says game based on the diminutive device that has four buttons and four LEDs. Judging from the video after the break, we’d say he nailed it!

There are so many design challenges here. First off, with only six pins total getting eight devices connected and working means doubling up on each I/O pin and using the reset pin as a doubled-up I/O. We’ve seen momentary push buttons on the same pins as LEDs before, so that’s not too hard to get working.

But if you’re using the reset pin how do you flash the thing? It doesn’t use the same ISP programming protocol that it’s bigger cousins do, so [Wrtlprnft] used an ATmega1284P to program it, hooking up to the three I/O pins and using a transistor to push 12V on the reset pin. But there’s still the matter of writing the code. It has half of the 32 registers you’d expect to find. He ended up ditching C and went straight to writing Assembly because of the diminished instruction set. It’s the first thing he’s written in Assembly, and a great way to learn the ropes.

12 thoughts on “ATtiny Hacks: ATtiny10 game – doing more with less”

I find this version more interesting and less cheatable. With the “normal” version you can just write down the additional digit after each round, if the sequence changes that’s more difficult and error-prone.

The program already has to memorize the sequence to verify it when the user enters it, so it’s not a technical challenge.

From the website: “The circuit is still in-system-programmable, the way the LEDs are wired up ensures that the LED on the reset pin only experiences a 7V reverse bias even when 12V are applied to that pin for programming, which it should survive.”

Nice…the problem with Simon is that you would always get to the point where your hands were not fast enough to move between those big buttons, and you couldn’t just hit the sides of them. It looks like this design fixes that.