This is my entry to the Hackaday.io 1KB challenge. It is three games squeezed into a PIC17F1705 MCU using eight 14-segments displays, eight buttons and a rotary (aka quadrature) encoder.
In order to save some code space I implemented the character set in hardware with 200+ diodes and a chain of five 74HC595 shift registers. This gives me 5*8=40 characters so I have 0..9 A..Z and +-= and .
The hardware character ROM saves me 40 words of code space (70 bytes since each word in the PIC16 is 14 bits). I probably could have squeezed in those bytes in a table with the current three games, but it was a fun thing to design and build.
The three games I've implemented in the 970 bytes (554 code words) are:
1) A 8-button "Simon" (remember and repeat and ever-increasing sequence)
2) Convert decimal numbers into binary as fast as possible
3) Sort a list of 8 letters in descending order as fast as possible
Components
1×
PIC 16F1705
Any PIC16F17xx can be used, and probably many more as well. I just happened to have a few of these
6×
74HC595
Any type of the 595 shift register should work
14×
BC547
Any small signal NPN like 2n2222 would work as well
8×
P-channel mostfet
Any model should work good enough
Since I soldered this on perfboard instead of on a real made pcb I didn't bother to draw the schematics in a PCB CAD package. So my hand-drawn scribbles will have to do.
Only the first three characters are shown in the diode-ROM, but all of them are documented in the code.
I've been able to squeeze in three games in the allotted 1KB space. A Sort-the-letters-in-reverse game, a Convert-decimal-to-binary game, and a Eight-button-Simon game.
The Simon game still needs scoring added to it, but luckily I have a bit of space left since I'm only at 519 words out of the maximum 585. So I guess I'll be able to add that and clean up the code a bit before the contest deadline tomorrow.
I have a few dozen of those type of display I bought surplus/on-sale at one point, and have never found the right project for them. This gets me thinking.
I had a list of games to do with the displays, but I could only fit three of them with the 1kb constraint. Unless I happen to kill the hardware by mashing it into my carry-on luggage I'll probably add a few more the comming weeks. But I could have use for a few more characters in the character set, so maybe I'll add one more PCB with '595s and diodes...
I feel like I'm home with all those diodes. Nice job.