MAX7219/7221 LED drivers

GroupDIY Audio Forum

Help Support GroupDIY Audio Forum:

This site may earn a commission from merchant affiliate links, including eBay, Amazon, and others.

ruffrecords

Well-known member
Joined
Nov 10, 2006
Messages
16,945
Location
Norfolk - UK
Has anyone used the MAX 7219/7221 LED drivers for audio meters? In theory one chip could do 8 bars graphs of 8 LEDs each or 4 of`16 each. Ideal for bus meters? Ans still available in a DIP package!

Cheers

Ian
 
I am not familiar with those particular ICs but recall Maxim making early LCD display drivers, etc. Over the years inside Peavey I saw several cheap LED display drivers come and go (EOL).

The ones we used inside Peavey seemed cheaper than those but maybe that's just inflation. 🤔 If you design it in maybe buy some extra JIC inventory.

JR
 
Plenty of breakout modules/hobbyist maker components.

https://www.switchelectronics.co.uk/products/8-x-8-dot-led-matrix-display-control-module-max7219

Here’s one ready to plug’n’play with.
It was stumbling across products like that that prompted me to look at the chip. It is unfortunate that very little data on those products exists and what is available is often confusing or incomplete. For example, the one you linked to says

"These are LED dot matrix displays with 8x8 x 4 = 32x8 red 3mm LEDs. These panels basically consist of four internally connected 8x8 matrix displays, each controlled by its own MAX7219 chip."

Rather cryptic don't you think?

Cheers

Ian
 
From what I’ve skimmed, you’d need an Arduino/Teensie/STM32/other microcontroller to make use of it - there’s a few libraries that will help.

Presumably you’re wanting to meter analog signals so you’d need 2x4 or an 8 channel ADC module - you don’t need anything fancy like 24bit or more than 25Hz sample rate - again, seems to be enough prior art or available modules to leverage.

That said, you can get a 128x64 OLED screen or even a 128x160 colour TFT screen for £5… 8x8 LED pixels for £5 seems extravagant!

I’ve been thinking about using those cheap OLED screens as digital meters in a DJ mixer… cheaper than physical VU meters and useful for secondary display functions.
 
Many of the AVR microcontrollers have built in A/D convertors and a multiplexer so a couple of audio inputs is no problem and as you say I2C libraries are readily available. So I have a good grasp on how to do it. My query was really more about whether anyone had actually used one.

Cheers

ian
 
you don’t need anything fancy like 24bit or more than 25Hz sample rate
Wile I agree for bit depth, you need way more than 25 samples per sec, especially if you process rectifying and integration at soft side whatever ballistic you want (PPM about 10ms sec integration, Vu about 300).
Also you may have issue interpreting frequencies over 12Hz...or read a tight snare with a useful content that probably stand less than 40ms
 
Wile I agree for bit depth, you need way more than 25 samples per sec, especially if you process rectifying and integration at soft side whatever ballistic you want (PPM about 10ms sec integration, Vu about 300).
Also you may have issue interpreting frequencies over 12Hz...or read a tight snare with a useful content that probably stand less than 40ms
I assumed the 25Hz referred to a system with external rectifiers.

Cheers

Ian
 
I assumed the 25Hz referred to a system with external rectifiers.
25Hz is roughly the number of frames per second to trick our eyes into perceiving motion.

@zamproject makes an excellent point about our ears needing a higher sampling rate than our eyes, and also, there’s some differences between a HiFi bar meter and a mixing console bar meter.
 
I assumed the 25Hz referred to a system with external rectifiers.
Still I think it's too slow ? even for Vu ballistic.
Some may calculate the integrator discharge for a 0 Vu signal appearing just after a tick and read at next one, 40ms is long (more that 10% of Vu integration time) but no idea if the target error will be marginal or not...
25Hz is roughly the number of frames per second to trick our eyes into perceiving motion.
Indicator update (and hold time) is another thing, for this particular use case it should be tested, and probably depend on actual indicator type LCD LED OLED...
IIRC my Vu meters (plasma) updates faster that 25Hz at comparator, and despite the plasma persistence sometime I can feel the -frame-
25Hz work well for movies, where frames rolling and overlapping ? Showing the frame 1ms every 40ms will not work.
 
This thread seems to have split into two topics;

1.Using the MAX 7219/7221 LED drivers in audio meters (the original topic)

2. How to convert audio in a micro to represent VU (or PPM) meters on said display

I am interested in both.

Cheers

ian
 
Which microcontroller are you thinking of using?

I'm wondering why you wouldn't just use a micro with enough pins to multiplex the LEDs directly (along with a few transistors)?
 
Which microcontroller are you thinking of using?

None in particular. The beauty of the MAX7219 and friends is its SPI interface so whatever micro you use it only needs a few pins. You might get away with something as simple as an Atmel ATTiny 8 pin DIP.
I'm wondering why you wouldn't just use a micro with enough pins to multiplex the LEDs directly (along with a few transistors)?
That is clearly a viable alternative but it would be handy to have a processor agnostic solution.

Cheers

Ian
 
Raspberry PI Pico or the new Pico 2 (RP2350 controller) would be good choice as there is already an example of using the SPI to control the MAX7219 in pico-examples repository:
https://github.com/raspberrypi/pico-examples/tree/master/spi/max7219_8x7seg_spi
Also the new RP2350 chip has 8 ADC (4 on the older RP2040) but you have to use the larger footprint chip for that. On the other hand those chips are so cheap that you could use multiple Picos to get the number of channels you need, or just add another 4-ch ADC externally. It is also handy as you could add any protocol (meaning I2S/PCM or TDM - not ADAT because the NRZI decoding is too complex for Pico) to bring in the audio data using the built-in programmable I/O controller (PIO).
 
Forgot to mention you can also work using Python only (Circuitpython) if that makes it easier:
https://github.com/leandrovrabelo/pico_max7219
https://github.com/adafruit/Adafruit_CircuitPython_MAX7219
For many applications the Pico would be ideal. I got one when they first came out to have a play with. Python is my favourite language and the porting of most of it to microcontrollers in the form of micro/circuit/python is a dream come true.

At the other end of the scale it is amazing what functionality you can squeeze into 8K of code on an 8 bit Atmel in C/assembler

Cheers

Ian
 
I've been prototyping with an attiny1617 driving 10 LEDs x 5 columns. One spare pin left over which i might use to choose different display modes. The code is written in C. I'm almost happy with it.

For the next version I will use the one of the newer AVR64EA32 microcontrollers. Mainly because the ADC is faster.
I used a VQFN package but a 28 pin PDIP package is available

I used an envelope follower based on the code in this link
https://www.musicdsp.org/en/latest/Analysis/97-envelope-detector.html
A low pass filter with independent attack and release rates
 
I've been prototyping with an attiny1617 driving 10 LEDs x 5 columns. One spare pin left over which i might use to choose different display modes. The code is written in C. I'm almost happy with it.
That seems only to be available in an SMT package?
For the next version I will use the one of the newer AVR64EA32 microcontrollers. Mainly because the ADC is faster.
I used a VQFN package but a 28 pin PDIP package is available
Very nice and up to 64K ROM - you could rule the world with that!
I used an envelope follower based on the code in this link
https://www.musicdsp.org/en/latest/Analysis/97-envelope-detector.html
A low pass filter with independent attack and release rates
Presumably you did it without resorting to floats.

Cheers

Ian
 
That seems only to be available in an SMT package?
I just rechecked that datasheet and no DIP package is shown but there's quite a few of the AVR's with a 28 pin through hole option

Presumably you did it without resorting to floats.
Not yet. That's on my to do list along with probing the spare pin with a scope to confirm the CPU and interrupts are running at the right speed and changing the linear regulator to a switching one. 32bit floats on an 8bit micro will slow things down a lot but I want to see what i can get a way with before optimising
 
I just rechecked that datasheet and no DIP package is shown but there's quite a few of the AVR's with a 28 pin through hole option


Not yet. That's on my to do list along with probing the spare pin with a scope to confirm the CPU and interrupts are running at the right speed and changing the linear regulator to a switching one. 32bit floats on an 8bit micro will slow things down a lot but I want to see what i can get a way with before optimising
Just to be clear are you taking audio straight into the AtoD and rectifying etc in software or do you rectify/attack/decay in external hardware?

Cheers

Ian
 

Latest posts

Back
Top