ATtiny Hacks: ATtiny10 game – doing more with less

ATtiny Hacks Theme Banner

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.

It may not be as polished, but we do like it just as much as the Karate Chop Simon Says game which has a lot of other bells and whistles.

Comments

  1. brad says:

    why does the sequence change every time? didn’t simon build on the existing sequence?

    • wrtlprnft says:

      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.

  2. chris says:

    @brad and after you’ve used most of the 32 *bytes* of memory for variables, you’re going to put the sequence where….?

  3. Bogdan says:

    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.”

  4. timbo says:

    I love the top side of his board! But go to the website and look at the back side WOAH nastiest solder blobs ever!! Still though great hack :D

  5. CMJ says:

    I did something similar! I did it in 5 pins charlieplexing the LED’s and using a divider for the button scheme.

    http://cmjdev.tumblr.com/post/8086495398/engineering-to-design-simonsays-part-2

    There’s a little info. Great build and nice size for doing it on perfboard!

  6. Boop says:
  7. KillerBug says:

    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.

  8. anyone says:

    very cool use of a 6pin device! i wish i could think of something this good to do with my PIC10 series device that i bought and is still sitting there, not being used.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

Join 96,764 other followers