-
Implementation
11/26/2016 at 13:06 • 0 commentsThe implementation into hardware is quite straightforward. I mananged to squeeze all components into a PCB that is ony 13 mm x 19 mm. One notable trick was to use an edge connector for the SPI/TPI interface. Using a normal 6 pin header could have easily doubled the size of the board.
The software uses a timer interrupt to multiplex the 7 LEDs. The main routine calls the TinyTouchLib to poll the touchbutton. If a button press is detected, the value of the die is increased.
It turns out, that due to the small physical size, the touchbutton is somewhat unreliable and detects multiple touches when pressed. So I am using this in lieu of a random number generator...
Compiler output:
Program Memory Usage : 644 bytes 62.9 % Full Data Memory Usage : 7 bytes 21.9 % Full
Still some space left.
-
Design considerations
11/26/2016 at 10:45 • 0 commentsThis is an attempt at an absolutely minimized electronics dice implementation. An entry for the Hackaday 1kb competition. Using an ATtiny10 as a MCU automatically limits the code size to 1kb, so the code size competition is automatically met.
The ATtiny10 only has three I/O lines - we need to control 7 LEDs in total. How?
This implementation manages to control all 7 LEDs using only two I/Os. See here for a description of the multiplexing scheme: https://cpldcpu.wordpress.com/2015/05/24/plexingplus/
Why no series resistors? Well, turns out you can get away with that when you minimize the duty cycle of the LEDs. Since the scheme required multiplexing anyways, this is automatically given.
The remaining I/O pin is used for a touch button to activate the dice. No push button is needed. I am using my TinyTouchLib for this, which also works on an ATtiny10.