Driving LED bar graphs

PaulRB

Senior Member
Hi DakLak, welcome to the forum.

I have 2 ideas for you:

1. Always put
Code:
 tags around any code you post.
2. Please read the previous posts in any thread before you join in the discussion. Both 4017 and max7219 have already been discussed and discounted in this design, for example.

Please take these comments as friendly constructive criticism!

Thanks,

Paul
 

nick12ab

Senior Member
Interface with a MAX7219 LED Bar Graph
The OP has already discounted max7219.

With modern microcontrollers that are sufficient to multiplex 8 digits being so cheap compared to a non-counterfeit MAX7219, I'm surprised it hasn't been discontinued yet. A genuine Atmega328 programmed with a certain bootloader can be programmed almost as easily as PICAXE and can be programmed to act as an i2c slave or serial LED multiplexer. Of course, that is only if the OP decides that PICAXE is unsuitable.
 

PaulRB

Senior Member
With modern microcontrollers that are sufficient to multiplex 8 digits being so cheap compared to a non-counterfeit MAX7219, I'm surprised it hasn't been discontinued yet.
While not wanting to hijack Sodapep's thread, I would like to point out how convenient max7219 is. No microcontroller I'm aware of can directly handle the currents needed to drive multiplexed led displays without external transistors or other driver ICs, or has built-in current amplifiers to remove the need for many current-limiting resistors. You just wire it straight up to the leds. But I have said before that it is way too expensive for what it is, and I'm not surprised how common the counterfeits are.
 

DakLak

New Member
Living next to China we get all sorts of 'cover' ICs at ridiculous prices, so they are attractive for reasons other than just technology. We buy our LEDs by weight and 1500 1/4 watt resistors cost USD$0.05.
 

MartinM57

Moderator
...how convenient max7219 is. No microcontroller I'm aware of can directly handle the currents needed to drive multiplexed led displays without external transistors or other driver ICs, or has built-in current amplifiers to remove the need for many current-limiting resistors.
Nail on the head, exactly. You can't build a 7219 from just a PICAXE/PIC/AVR/*ino

AS1107 - exactly the same (plus a bit more) as a MAX7219 and a lot cheaper. SOIC only though. Quite cheap at 100+ off from uk.mouser.com :)
 

techElder

Well-known member
AS1107 LED Driver IC

Interesting information about "bar-graph display" from AMS.

SOURCE: http://www.ams.com/eng/Products/Lighting-Management/LED-Driver-ICs/AS1107

The AS1106 and AS1107 are ideal for bar-graph displays ...

Key Features

10MHz SPI-, QSPI-, Microwire-Compatible Serial I/O
Individual LED Segment Control
Segment Blinking Control (can be synchronized across multiple drivers)
Hexadecimal- or BCD-Code/No-Decode Digit Selection
3µA Low-Power Shutdown Current (typ; data retained)
Extremely Low Operating Current 0.5mA in Open-Loop
Digital and Analog Brightness Control
Display Blanked on Power-Up
Drive Common-Cathode LED Displays
Low-EMI Low Slew-Rate Limited Segment Drivers (AS1107)
Supply Voltage Range: 2.7 to 5.5V
Software Reset
Optional External Clock
Packages:
24-pin DIP
24-pin SOIC

View attachment AS1106_07_Datasheet_v2_28.pdf
 

MartinM57

Moderator
oh yes - I forgot they were DIP as well - I even have a couple! But IIRC the DIP ones are quite a bit more expensive and also much harder to source.
 

Buzby

Senior Member
Do you need special displays to work with a Charlieplexing driver, do you think? Normal multiplexed displays wouldn't have compatible internal wiring, would they?

Take a normal 8x8 matrix, then wire all the rows to 8 pins on the PICAXE, and then wire all the columns to the same 8 pins.

You have now got a Charliplexed 8x7 matrix, with 56 active LEDs.
Unfortunately, the 8 non-active LEDs will be in a diagonal line from one corner to the opposite, rather limiting what you can display.
( The non-active LEDS are the ones which have the same IO pin connected to both sides of the LED. )

One idea I did have, but not yet explored, is could 7x5 displays be mounted side-by-side, with the non-active LEDs occupying the 'virtual locations' in the 8x7 Charlie matrix ?.

Might be worth an investigate. It would simplify the wiring job !.
 

Buzby

Senior Member
There is an old saying, 'There is nothing new under the Sun'.

So somebody did beat me to the solution of using standard LED modules with Charlieplexing.
( He only just beat me, the date of the page is March this year !. )

It's a good page though, so I'll bookmark it for later study. ( But I didn't quite get the point of 'Charliee the unicorn'. )

Cheers,

Buzby
 

nick12ab

Senior Member
Quote from the page
Overclock the processor. Most AVRs are configured to 1MHz by default, but can run up to 8MHz even without an external crystal. The AVR fuse calculator is a godsend. Test the program first without overclocking, then raise the clock rate. Ensure that the power supply voltage is high enough for the selected clok rate. If things get dire and you need more speed, you can tweak the OSCCAL register as well.
The PICAXE interpreter makes PICAXE very slow compared to an AVR or other microcontroller running compiled code. If a microcontroller running compiled code is barely fast enough, should PICAXE even be considered?
 

Buzby

Senior Member
... If a microcontroller running compiled code is barely fast enough, should PICAXE even be considered?
PICAXE Charlieplexing ? - A very big YES !.

It's not the size of the matrix that matters, it's the number of simultaneous lit LEDs.

For example, a 'Pong' type game could be played on a big matrix, but maybe only needs a dozen LEDs lit at once. PICAXE could handle this.

A 'Black Box' ray-deducing game could have a huge grid, but only needs a few LEDs lit at once.

My orrery has 528 LEDS, but only nine are lit at once.

Another use is not as a dynamic refreshed graphic matrix, but as, say, the 49 numbers on a lottery machine, or the 99 numbers on a bingo card.

Or an LED above each key on a piano, showing which to press next.

There is no problem using a PICAXE to Charlieplex up to, at least, 30 simultaneous lit LEDs, no matter how big the matrix.

Give it a try. The 80 LED bargraph is a great starting point. Very easy to wire on a piece of stripboard, and easy to see the logic needed when programming.

Cheers,

Buzby
 

hippy

Ex-Staff (retired)
PICAXE Charlieplexing ? - A very big YES !.

It's not the size of the matrix that matters, it's the number of simultaneous lit LEDs.
And the number of LED's can be quite substantial. A 20X2 at 64MHz can charlieplex 7x8 (56) LED's individually in about 5ms.

A single LED on is a walk in the park. It's not really multiplexing so much as setting the right I/O then leaving it until it needs to change. The rate of change it would support is far greater than any practical rate of change needed.

There are limits to what a PICAXE can achieve, but there are also limits to what any micro can achieve; that's why there are dedicated multiplex drivers designed to overcome those limitations.
 

erco

Senior Member
I'm late to the party, but I see LM3914s all over ebay at 5 pc for $4 USD. Dodgey perhaps, but not cost prohibitive.
 
Last edited:

PaulRB

Senior Member
I'm late to the party.
To be honest, the OP has gone off to do some real electronics and we're just chatting and wandering off the topic a bit. LM7214 was conclusively eliminated as it can really only go up to 30 leds with 3 chips, and 80 was the target.
 

Sodapep

Member
I'm glad the discussion continued! I got caught up in writing my thesis, but I'm still getting this project together.
 
Top