Controlling 16 segment displays (For A noob XD)

I need a way to multiplex 3 16 segment displays with my arduino. I am already multiplexing a few 7 segment displays with a MAX7221, but now I have a problem with my 3 16-segment displays. If you were wondering, I am making the time circuits from BTTF. I need something I can order in the UK. Please don't be too complex (I'm a noob XD). I am asking for hardware advice only. A bit of code would be great, but not strictly required.

Thank you very much for your time,
Dawid

Hello. Have you considered the ht16k33? Are your displays common cathode or common anode?

It can drive up to 8 common cathode 16-seg displays and has an i2c interface so needs only 2 arduino pins.

Paul

Not naming the display type was a bit stupid of me. I can use any display. Thank you for your help!

You say you can use either common anode or common cathode? Do you have the displays yet, or do you not? If so, what are they (link to datasheet)?

I mean I can use either. I have not ordered the displays, but I am planning on getting http://docs-europe.electrocomponents.com/webdocs/13c8/0900766b813c8fc8.pdf (CC) or this http://docs-europe.electrocomponents.com/webdocs/13c8/0900766b813c8fc5.pdf (CA)

Thanks,
Dawid

You should choose common cathode for use with the ht chip. If your 7 seg displays are also CC, it can run those too, potentially up to 10 digits, depending on configuration.

I assume the 3 x 16 seg displays will show the month and you will have a 4 x 7 segs for year and 2 x 7 segs for day? The ht chip could run them all.

If that's not enough, you can attach up to 8 ht chips to the i2c bus (i,e. same two arduino pins, A4 & A5 on Uno/Nano).

I have already settled on using 2 MAX7221's as I need 10 7 segment displays and it seems like there is more support for the 7221.
Thanks,
Dawid

You should think about the overall complexity of the circuit before you make a final decision. If you choose to use an ht chip for the 16 seg displays, it will be simpler overall to use them for all your displays.

The max chips may have more support, but that does not avoid having to deal with the less well supported ht chip, and instead you have two different chips to deal with, which will have to have separate code, use a separate bus, possibly separate libraries. Everything becomes twice as complex.

:o I am finding this really hard... So, I have 3 16-Segment displays that I want to drive, multiplexed with the HT16K33. I'm really frustrated because I have no idea how the code works :frowning: (Yes, I am a noob.) and the only example code I can find is this and it doesn't really help me. I am trying to get the displays to show:
JAN
FEB
MAR
APR
MAY
JUN
JUL
AUG
SEP
OCT
NOV
DEC

You're right, that's not the most helpful example for a beginner.

I suggest next steps:

  1. Make a list of all the individual letters you need to use (no Z for example)
  2. For each letter you need, figure out the segments on the 16 seg display that need to be lit.
  3. Work out which anode output from the ht chip controls each segment.
  4. Make a grid on a sheet of squared paper, with a row for each letter and a column for each anode output. Mark each position in that grid where the segment needs to be on for that letter.

PaulRB:
You're right, that's not the most helpful example for a beginner.

I suggest next steps:

  1. Make a list of all the individual letters you need to use (no Z for example)
  2. For each letter you need, figure out the segments on the 16 seg display that need to be lit.
  3. Work out which anode output from the ht chip controls each segment.
  4. Make a grid on a sheet of squared paper, with a row for each letter and a column for each anode output. Mark each position in that grid where the segment needs to be on for that letter.

I get that part but I don't know how to drive individual segments, or dots on a grid, with code.

Wait a moment! Looks like the Adafruit library has already done that work for you and it provides a function to write a letter to the display, writeDigitAscii().

Look at this example.

PaulRB:
Wait a moment! Looks like the Adafruit library has already done that work for you and it provides a function to write a letter to the display, writeDigitAscii().

Look at this example.

Great, but that code is for their ht16k33 backpack and I have the standalone breakout. Do you know how I can wire the LEDs?

Hang on, maybe I spoke too soon. The Adafruit Alpha displays are not same as yours. They have fewer segments. So the Adafruit library won't be able to write letters to your display without modifying the library.

PaulRB:
Hang on, maybe I spoke too soon. The Adafruit Alpha displays are not same as yours. They have fewer segments. So the Adafruit library won't be able to write letters to your display without modifying the library.

:frowning: well that isn't good!

My ht16k33 arrived today so I can do some breadboard tests! :slight_smile:

dawidziaja:
:frowning: well that isn't good!

It's inconvenient, that's all. If you download & install the library, you will find a file called Adafruit_LEDBackpack.cpp. In that file is the following:

static const uint16_t alphafonttable[] PROGMEM =  {

0b0000000000000001,
0b0000000000000010,
0b0000000000000100,
0b0000000000001000,
0b0000000000010000,
0b0000000000100000,
0b0000000001000000,
0b0000000010000000,
0b0000000100000000,
0b0000001000000000,
0b0000010000000000,
0b0000100000000000,
0b0001000000000000,
0b0010000000000000,
0b0100000000000000,
0b1000000000000000,
0b0000000000000000,
0b0000000000000000,
0b0000000000000000,
0b0000000000000000,
0b0000000000000000,
0b0000000000000000,
0b0000000000000000,
0b0000000000000000,
0b0001001011001001,
0b0001010111000000,
0b0001001011111001,
0b0000000011100011,
0b0000010100110000,
0b0001001011001000,
0b0011101000000000,
0b0001011100000000,
0b0000000000000000, //  
0b0000000000000110, // !
0b0000001000100000, // "
0b0001001011001110, // #
0b0001001011101101, // $
0b0000110000100100, // %
0b0010001101011101, // &
0b0000010000000000, // '
0b0010010000000000, // (
0b0000100100000000, // )
0b0011111111000000, // *
0b0001001011000000, // +
0b0000100000000000, // ,
0b0000000011000000, // -
0b0000000000000000, // .
0b0000110000000000, // /
0b0000110000111111, // 0
0b0000000000000110, // 1
0b0000000011011011, // 2
0b0000000010001111, // 3
0b0000000011100110, // 4
0b0010000001101001, // 5
0b0000000011111101, // 6
0b0000000000000111, // 7
0b0000000011111111, // 8
0b0000000011101111, // 9
0b0001001000000000, // :
0b0000101000000000, // ;
0b0010010000000000, // <
0b0000000011001000, // =
0b0000100100000000, // >
0b0001000010000011, // ?
0b0000001010111011, // @
0b0000000011110111, // A
0b0001001010001111, // B
0b0000000000111001, // C
0b0001001000001111, // D
0b0000000011111001, // E
0b0000000001110001, // F
0b0000000010111101, // G

Etc. You will need to change those binary patterns to match how you wire up your displays.

PaulRB:
It's inconvenient, that's all. If you download & install the library, you will find a file called Adafruit_LEDBackpack.cpp. In that file is the following:

static const uint16_t alphafonttable[] PROGMEM =  {

0b0000000000000001,
0b0000000000000010,
0b0000000000000100,
0b0000000000001000,
0b0000000000010000,
0b0000000000100000,
0b0000000001000000,
0b0000000010000000,
0b0000000100000000,
0b0000001000000000,
0b0000010000000000,
0b0000100000000000,
0b0001000000000000,
0b0010000000000000,
0b0100000000000000,
0b1000000000000000,
0b0000000000000000,
0b0000000000000000,
0b0000000000000000,
0b0000000000000000,
0b0000000000000000,
0b0000000000000000,
0b0000000000000000,
0b0000000000000000,
0b0001001011001001,
0b0001010111000000,
0b0001001011111001,
0b0000000011100011,
0b0000010100110000,
0b0001001011001000,
0b0011101000000000,
0b0001011100000000,
0b0000000000000000, // 
0b0000000000000110, // !
0b0000001000100000, // "
0b0001001011001110, // #
0b0001001011101101, // $
0b0000110000100100, // %
0b0010001101011101, // &
0b0000010000000000, // '
0b0010010000000000, // (
0b0000100100000000, // )
0b0011111111000000, // *
0b0001001011000000, // +
0b0000100000000000, // ,
0b0000000011000000, // -
0b0000000000000000, // .
0b0000110000000000, // /
0b0000110000111111, // 0
0b0000000000000110, // 1
0b0000000011011011, // 2
0b0000000010001111, // 3
0b0000000011100110, // 4
0b0010000001101001, // 5
0b0000000011111101, // 6
0b0000000000000111, // 7
0b0000000011111111, // 8
0b0000000011101111, // 9
0b0001001000000000, // :
0b0000101000000000, // ;
0b0010010000000000, // <
0b0000000011001000, // =
0b0000100100000000, // >
0b0001000010000011, // ?
0b0000001010111011, // @
0b0000000011110111, // A
0b0001001010001111, // B
0b0000000000111001, // C
0b0001001000001111, // D
0b0000000011111001, // E
0b0000000001110001, // F
0b0000000010111101, // G



Etc. You will need to change those binary patterns to match how you wire up your displays.

How exactly do i read this binary code?

I am making an assumption here, but i think bit 0 of those binary codes will appear at output A0 on the ht chip and bit 15 will appear at output A15. When you wire the chip up to your display, make notes about which of the anode outputs (A0 to A15) you connect to which segments (a to u). Then you will need to work out the binary code needed to form each character and put it in that file. For example to make the letter "A" you need to light segments a, b, c, d, g, h, u & p. So you put 1 in the binary code for those segments and 0 for the segments that will be off.

Makes sense now. Thanks!

Well, I have come to the conclusion that my ht16k33 is BROKEN :frowning: It can't even light a single led. So sad. Should I give the MAX6954 a go?