HT16K33 and MAX6955 LED Drivers
Posted: Thu Dec 04, 2025 10:35 pm
Creating a component for the MAX6955 display driver had been mentioned - and as the HT16K33 is closely comparable (it lacks an inbuilt character set and per digit brightness) - doing both at the same time seemed a good idea (to me at least
)
These LED drivers can drive 8 x 14 segment (+dp) displays - or 128 LEDs or handle an array of buttons (debounced in the case of the MAX chip). To complicate things slightly - they can also handle 16 x 7 segment displays!
The HT16K33 arrived first (AliExpress) - and it has 4 x 14 segment digits attached.
I'm hoping others will contribute - or at least play along. My first step (always) - is a very basic program - to check that I can actually 'talk' to the hardware - no point in writing reams of code - to find that nothing is displayed!
So - step 1) Initialise the display
Step 2) Output some data
Initialisation is simple - I added properties to the 2d panel for number of digits and i2c address (this 0x70 usually) - and the i2c_master component. I used an Arduino (mainly for speed - upload etc to an esp32 for example is much slower) - as a a robust test bed.
The display needs SDA, SCL, Gnd, VCC and VI2C (which sets the level for the i2c comms / logic VCC drives the LEDs)
To initialise we send 0x21 (start the oscillator), 0x81 (display on) and 0xEF (set brightness to 15 (max) - note this will need modifying on the MAX device) I set each display to 0xFFFF (illuminate everything - unnecessary but fun) then 0 (all off)
Then I write each possible value to each display - actually just the main segments (not the dp) - and all seems good
The description probably took longer to write than the program!
One thing to note - each digit takes a 16 bit value defining the state of each individual LED segment - we will use a lookup table to define our character set. To write to a digit - the address is digit * 2. I'm not sure if the address auto increments - so to check data sheet - for extra speed when writing multiple digits..
Martin
These LED drivers can drive 8 x 14 segment (+dp) displays - or 128 LEDs or handle an array of buttons (debounced in the case of the MAX chip). To complicate things slightly - they can also handle 16 x 7 segment displays!
The HT16K33 arrived first (AliExpress) - and it has 4 x 14 segment digits attached.
I'm hoping others will contribute - or at least play along. My first step (always) - is a very basic program - to check that I can actually 'talk' to the hardware - no point in writing reams of code - to find that nothing is displayed!
So - step 1) Initialise the display
Step 2) Output some data
Initialisation is simple - I added properties to the 2d panel for number of digits and i2c address (this 0x70 usually) - and the i2c_master component. I used an Arduino (mainly for speed - upload etc to an esp32 for example is much slower) - as a a robust test bed.
The display needs SDA, SCL, Gnd, VCC and VI2C (which sets the level for the i2c comms / logic VCC drives the LEDs)
To initialise we send 0x21 (start the oscillator), 0x81 (display on) and 0xEF (set brightness to 15 (max) - note this will need modifying on the MAX device) I set each display to 0xFFFF (illuminate everything - unnecessary but fun) then 0 (all off)
Then I write each possible value to each display - actually just the main segments (not the dp) - and all seems good
The description probably took longer to write than the program!
One thing to note - each digit takes a 16 bit value defining the state of each individual LED segment - we will use a lookup table to define our character set. To write to a digit - the address is digit * 2. I'm not sure if the address auto increments - so to check data sheet - for extra speed when writing multiple digits..
Martin