I've been curious for a long time about the mighty ATtiny10 and what can do such a small device. First I had to figure out how to program it through the TPI interface (details here). Then I tried to drive an OLED display with a bit-banged TWI (also details in this post). Having obtained a good result, I thought to push it further. And what's better than fit a game into 1kb flash memory?
Having played around for a bit, I realized that C would not work for this: the compiled code was taking too much space. Therefore I learned the Assembly basics and I started mixing it with C (I wrote some tips here).
I ended up writing the entire code in Assembly.
I posted the code on GitHub and I tried to comment every line as clearly as possible.
After having spent quite some time coding it, I thought was the case to design a proper PCB. I designed it to be as small as possible: this is going to be a keychain!
Now, there's a problem: after the phone, the laptop and the watch, I don't want to charge the keychain too.
So I need an alternative power source.
The only feasible energy source is solar even if it's a challenge to extract enough power from such a small surface.
I did some prototyping and the simplest, cheapest solution I found is to boost the voltage from the photovoltaic cells using an MCP1640. The output voltage is used to charge a supercapacitor of 0.1F or 0.22F that acts as a buffer (more details in the log).
The booster is set to output 3.5V and the game keeps working until the supercapacitor is discharged to 1.8V. The 0.22F discharges in about 30 seconds.
This is enough time to enjoy some rounds.
The idea is that you will leave the keychain at the sun for some time (a minute or two) and then play for a while. What if there is no sun, you ask?
Well, there is no game... but this is implied by being "solar-powered" (actually it can be powered using the TPI port).
Awesome project. I would love one for my keychain.