Holiday Electronics Projects: Technical details and Reference data

This article contains some reference data relevant to the holiday electronics projects.

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:

Byte High Byte Low
Segment c p f e d r n b a m k h u s t g
I/O Pin A1 A0 D6 D5 D3 D2 D1 D0 B7 B6 B5 B4 B3 B2 B1 B0

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

3 thoughts on “Holiday Electronics Projects: Technical details and Reference data

  1. Is this possible?
    My dad and I want emsl menorahs we can wear as lapel pins!
    [sorry an additional extraneous idea here: i like everything the menorah now does, but additionally itd be swell if a lapel pin version could also set the LEDs to alternately display
    1) the animation through the 8 set-ups, and
    2) either the current night of hanuka, or if worn before that, the first night.
    it would either switch to or hesitate on the selected appropriately numbered night, then either blink a sec or not then strobe again. dream on!]
    but first,on point, is there any reason i cant set up/hotglue a pinback on the little menorah itself, a pinback on the battery casing, and cut the [compared to the rest of it] ugly wire between em, with some sorta sockety thing [are there such? what is it called?] so it clicks back together after stringing it through a lapel hole?
    seriously. my dad and i need em.
    on groundhog’s day he turned 80, so he needs his first.
    is there any way i can paypal you the capital to get one for him?
    thank you!
    jay
    ps yet 2 more serious questions: do you like/tolerate/sometimes use suggestions? hope so. =D hate my notes? need to know can i can do right by you
    im MAD about your inventions and IN LOVE with watching the EMSL vision beautifully corrupt minds. mwahahahahaha
    thank you

  2. hi,
    i am trying to adjust fonts-adding numbers to font list. all i get out is nonsense.
    this is what came up for fonts:

    34816,61833,63880 //1,2,3
    18456,22936,30745 //4,5,6
    51584,63897,51608 //7,8,9
    47505 //0

    anyone tried with numbers before?
    regards,
    Peter

Comments are closed.