Holiday Electronics Projects: Technical details and Reference data
| Our microcontroller is the Atmel ATtiny2313; you can find the details on Atmel's site. This is a simplified drawing of the microcontroller pinouts, showing the pins as they are configured for the two holiday electronics project. All of the lines shown, except power, ground, and reset, are configured as general purpose outputs, and are capable of sourcing plenty of current to drive LEDs. |
|
| For the menorah, the external configuration of the nine LEDs is particularly simple: The cathodes of the nine LEDs connect to pins 2-10, and the anodes to pins 11-19. Be aware that the LED in the middle acts like the "lighter" candle. |
|
| The alphanumeric LED display that we are using for the micro-readerboard ornament is the Kingbright PSA08-11HWA. You can find the detailed datasheet for the display here. I've excerpted the most important part, which is how the pins map to the segments of the display: | |
![]() |
![]() |
| In our assembled ornament, the microcontroller sits on the back side of the LED display such that most of the ATtiny2313 output pins go to inputs of the LED display. The microcontroller has 20 pins while the display only has 18, so microcontroller pins 1 and 20 do not directly line up with any pins on the display. Pin 2 of the ATtiny2313 goes to pin 18 of the display, pin 11 of the ATtiny2313 goes to pin 9 of the display, and pin 19 of the ATtiny2313 goes to pin 1 of the display. | |
|
Font Table For each letter that might be displayed on the ornament, we determined which segments should be lit up. Those segments to be lit are marked by a binary #1, and those to be dark are marked with a binary #0. The sixteen binary digits that determine the state of the sixteen segments comprise two bytes worth of data, the order of the bits in the two bytes is determined by the physical location of the pins on the microcontroller and the pins on the LED display. For example, segment 'a' of the display is controlled by pin 1 of the display. Pin 1 of the display touches pin 19 of the microcontroller, which is output B7. Following similar logic, the format of the two bytes is as follows: | |||||||||||||||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||||||||||||||
|
With this definition of the two data bytes, it was possible to construct the data table, with its 16-bit binary representation of each letter. The decimal value (unsigned integer) corresponding to the binary number is also given; these are the 'practical' values that were used in the C code.
Note that since the PSA08-11HWA is a common-anode device, its pins are actually driven by negative logic: a logical '0' on a given pin of the display turns on one of the segments. The data table with its binary and decimal digits is entirely in "positive" logic (which is generally easier to work with), so a bitwise NOT is applied to each output data byte that goes to the outputs. If you code a version of the ornament (or something else) that uses the common-cathode version of this display (the PSC08 series), you should be able to adapt to it by removing the bitwise NOT from the existing code. | |||||||||||||||||||||||||||||||||||||||||||||||||||
| Character | ASCII #d | Segments Lit | Byte High | Byte Low | Decimal Val. | ||
|---|---|---|---|---|---|---|---|
| A | 65 | ghkru | 0000 | 0100 | 0011 | 1001 | 1081 |
| B | 66 | abcdefmps | 1111 | 1001 | 1100 | 0100 | 63940 |
| C | 67 | abefgh | 0011 | 0001 | 1001 | 0001 | 12689 |
| D | 68 | abcdefms | 1011 | 1001 | 1100 | 0100 | 47556 |
| E | 69 | abefghu | 0011 | 0001 | 1001 | 1001 | 12697 |
| F | 70 | abghpu | 0100 | 0001 | 1001 | 1001 | 16793 |
| G | 71 | abdefghp | 0111 | 1001 | 1001 | 0001 | 31121 |
| H | 72 | cdghpu | 1100 | 1000 | 0001 | 1001 | 51225 |
| I | 73 | abefms | 0011 | 0001 | 1100 | 0100 | 12740 |
| J | 74 | cdefg | 1011 | 1000 | 0000 | 0001 | 47105 |
| K | 75 | ghnru | 0000 | 0110 | 0001 | 1001 | 1561 |
| L | 76 | efgh | 0011 | 0000 | 0001 | 0001 | 12305 |
| M | 77 | cdghkn | 1000 | 1010 | 0011 | 0001 | 35377 |
| N | 78 | cdghkr | 1000 | 1100 | 0011 | 0001 | 35889 |
| O | 79 | abcdefgh | 1011 | 1001 | 1001 | 0001 | 47505 |
| P | 80 | abcdghpu | 1100 | 0001 | 1001 | 1001 | 49561 |
| Q | 81 | abcdefghr | 1011 | 1101 | 1001 | 0001 | 48529 |
| R | 82 | abcghpru | 1100 | 0101 | 1001 | 1001 | 30585 |
| S | 83 | abdefhpu | 0111 | 1001 | 1001 | 1000 | 31128 |
| T | 84 | abms | 0000 | 0001 | 1100 | 0100 | 452 |
| U | 85 | cdghef | 1011 | 1000 | 0001 | 0001 | 47121 |
| V | 86 | ghnt | 0000 | 0010 | 0001 | 0011 | 531 |
| W | 87 | cdghrt | 1000 | 1100 | 0001 | 0011 | 35859 |
| X | 88 | knrt | 0000 | 0110 | 0010 | 0010 | 1570 |
| Y | 89 | kns | 0000 | 0010 | 0010 | 0100 | 548 |
| Z | 90 | abefnt | 0011 | 0011 | 1000 | 0010 | 13186 |
| * | 42 | kmnprstu | 0100 | 0110 | 0110 | 1110 | 18030 |
| (space) | 32 | - | 0000 | 0000 | 0000 | 0000 | 0 |







