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.
[youtube=http://www.youtube.com/watch?v=7bvOEQlV4Tk&w=470]
why does the sequence change every time? didn’t simon build on the existing sequence?
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.
@brad and after you’ve used most of the 32 *bytes* of memory for variables, you’re going to put the sequence where….?
@Chris: Packed bytes. Clever encodings. LFSR. Rand() with seeds. LOTS of ways to stretch a few measly bytes :) Cheers, tim
Use bitmaps, procedural generation, any kind of adequate compression?
Just a thought, 2 bits needed for 4 LEDs, w/8 bits, you can store 4 sequences, 16 sequences can be placed in 4 bytes of ram.
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.”
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
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!
Competition?
http://hackaday.com/2011/06/26/attiny13-powered-handheld-helicopter-game/
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.
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.