How to control 12 seven segment digits - Page 1
Forum section: electronics / general

author: jkl12
author_rank: Newbie
timestamp: March 03, 2015, 11:19:34 am
content: Hi,I have the AT89S8253 and using it I need to control 12 seven segment digits (common anode).I've seen the method of scanning through every segment but with so many segments I would have thought the light would be too dim to see. Can anyone suggest a better method for controlling these 12 digits as I'm a little lost. I can use up to 2 of the uC ports to control them all.Thanks for any help

author: BradC
author_rank: Super Contributor
timestamp: March 03, 2015, 11:25:00 am
content: Quote from: jkl12 on March 03, 2015, 11:19:34 amYou'd be really surprised. Just turn up the current. Led's work ok on an average dissipation level, so running a 20mA LED on 100mA is generally fine if it's on a 20% duty cycle. Heck, some IR remotes I've seen pump half an amp into the LED for *very* short but *very* bright pulses.The other thing you can do if you are *really* worried about it is chain each led to a shift register and just drive them statically. Ugly, but a whole lot quieter (EMC wise).

author: Kjelt
author_rank: Super Contributor
timestamp: March 03, 2015, 12:27:18 pm
content: Normally you would use a dedicated led driver for this sort of stuff like the old MAX7219 or newer MAX6950 and you probably need two of them since they go up to 8 digits. Yes you can use the uC itself but it takes a lot of GPIO ports and the current is limited.

author: mij59
author_rank: Frequent Contributor
timestamp: March 03, 2015, 12:36:42 pm
content: Search on eBay for the TM1638 or TM1640.Here's a review of the TM1638,

author: jkl12
author_rank: Newbie
timestamp: March 03, 2015, 12:50:01 pm
content: Quote from: Kjelt on March 03, 2015, 12:27:18 pmBoth those are for common cathode displays I think. Are there equivalents for common anode?

author: AndreasF
author_rank: Frequent Contributor
timestamp: March 03, 2015, 12:57:03 pm
content: How about a series of (SIPO) shift-registers, e.g. one for each digit?

author: BlueBill
author_rank: Regular Contributor
timestamp: March 03, 2015, 01:22:27 pm
content: Drive 12 digits using 12 output bits and the segments using a PNP 7 transistor array using a 3 to 8 demux. I used a CD4017 johnson counter to do something similar.

author: Kjelt
author_rank: Super Contributor
timestamp: March 03, 2015, 03:20:12 pm
content: Quote from: jkl12 on March 03, 2015, 12:50:01 pmThere are but more rare and pricy like the ICM7218.But if you design the product you should research the ic's available and pricing and adjust the rest, what's stopping you from using common cathode displays?

author: jkl12
author_rank: Newbie
timestamp: March 03, 2015, 03:25:14 pm
content: Quote from: Kjelt on March 03, 2015, 03:20:12 pmThe reason I'd rather use common anode is that I already have some on me, but if its much cheaper/easier to use common cathode i could probably get them instead

author: westfw
author_rank: Super Contributor
timestamp: March 04, 2015, 06:08:42 am
content: I would think that multiplexing 12 digits * 8 segments would work OK; you'll need a decoder or two, or counters, to get the 12 digit anode voltages.Note that you should be about to check the 1/12 multiplexing for brightness by connecting only a single digit.Common Anode displays are a better match for the 8051-class chips, if you don't use a separate driver chip. But... several chips and/or a bunch of transistors as support circuitry.

author: jkl12
author_rank: Newbie
timestamp: March 04, 2015, 12:40:19 pm
content: Quote from: westfw on March 04, 2015, 06:08:42 amThis seems the easiest way so far to me. My only problem is that according to the AT89S8253 data sheet each pin can sink 10mA (which is fine) but also each port can only sink 15mA, which would not be enough for a whole digit surely?

author: Rolo
author_rank: Regular Contributor
timestamp: March 04, 2015, 03:11:50 pm
content: You might take a look at the WS2803. 18 pwm outputs, current regulated, no resistors needed, two control lines. And ...cheap.Used it on my Lumitron module.

author: slburris
author_rank: Frequent Contributor
timestamp: March 04, 2015, 05:03:24 pm
content: How about the TC62D748CFNAG? About $1 in single qty, you would need 1 per2 displays. Orderable from Mouser and Digikey, so easy to get. Serial shift in won't use many pins.http://www.semicon.toshiba.co.jp/info/docget.jsp?type=datasheet&lang=en&pid=TC62D748CFNAGThere are many many workalike chips in the space, e.g. CAT4016Some are a harder to buy than others.Scott

author: Howardlong
author_rank: Super Contributor
timestamp: March 04, 2015, 05:34:57 pm
content: Quote from: westfw on March 04, 2015, 06:08:42 amFor completeness, you should have series resistors to the transistor bases with this design to avoid blowing the B/E junctions, or imdeed the '138 outputs.In addition you could save on port bits using just four if you parallelled up A/B/C inputs and used a fourth GPIO on a complementary G inputs of the 138.

author: mikerj
author_rank: Super Contributor
timestamp: March 05, 2015, 03:59:31 pm
content: To reduce the multiplex ratio you could add some latches and double up the segment drivers so you can drive more than one digit at a time.

author: BlueBill
author_rank: Regular Contributor
timestamp: March 05, 2015, 05:03:52 pm
content: What's wrong with muxing the segments so you have a 1:8 duty?Short of drawing a schematic...12 output pins: one each to the CA via 470ohm resistor.3 output pins: ABC of a CA4051 3to8 demux, each output via 1K resistor to an NPN transistor (or directly drive a ULN2803).NPN transistor emitter to GND, collector to segment A-G + dp set on all 12 displays.optional additional I/O to do blanking on INH pin of CD4051, handy when updating the digits.

author: neslekkim
author_rank: Super Contributor
timestamp: March 05, 2015, 08:07:57 pm
content: Quote from: Rolo on March 04, 2015, 03:11:50 pmWhere did you find dip modules?, I ordered from to places, the picture from one place looked like dip, but later I saw both purchases are smd typesFarnell doesn't seem to stock this kind

author: westfw
author_rank: Super Contributor
timestamp: March 06, 2015, 12:33:32 am
content: QuoteAn interesting idea. The software side would be annoying; you would have to decode all 12 digits in parallel.

author: BlueBill
author_rank: Regular Contributor
timestamp: March 06, 2015, 05:00:00 am
content: Quote from: westfw on March 06, 2015, 12:33:32 amAt the hardware level I can't imagine a much simpler / cheaper solution. Software wouldn't be that complicated, interrupt driven, moving the 12 display bits onto two output ports, address the segment or dp 0-7, repeat. Also handy if you want to read 8 switches, just add an input port & 8 diodes.

author: dannyf
author_rank: Super Contributor
timestamp: March 06, 2015, 01:42:28 pm
content: QuoteYou can multiplex the display - drains mcu's processing capabilities, need lots of pins but the simplest / lowest cost solution;You can use shift registers - can be static or dynamic, and pin usage can be reduced. Simple and easy.You can use dedicated display drivers, like max7219 or even other mcus - simplest solution from a programming point of view. most expensive and complicated from a hardware perspective.Pick your poison.

author: Rolo
author_rank: Regular Contributor
timestamp: March 06, 2015, 05:33:53 pm
content: Quote from: neslekkim on March 05, 2015, 08:07:57 pmIn 2013 I bought these WS2803 in DIP package on Ebay, form China. Paid about $15 for ten pieces. But now it does look the DIP is getting out of fashion, I did a quick search after reading your question and indeed, only the SOP package shows up now. Should you decide to use the SOP please test it first on a breakout/breadboard before production of PCB's. There is an error in the datasheets with the SOP. What I have read on other forums is that the SOP has the same pinout as the DIP. THe datasheet says it is diffferent.I did not use the SOP myself.

author: Rolo
author_rank: Regular Contributor
timestamp: March 06, 2015, 06:25:27 pm
content: Update : Found the DIP version of the WS2803 onhttp://www.aliexpress.comjust do a search on "WS2803 DIP".

author: neslekkim
author_rank: Super Contributor
timestamp: March 06, 2015, 07:29:15 pm
content: Quote from: Rolo on March 06, 2015, 06:25:27 pmGreat, found it there.

author: ralphd
author_rank: Frequent Contributor
timestamp: March 07, 2015, 02:48:29 am
content: I've found 7-segment LED displays are still quite visible down to 0.1mA. I looked at the datasheet for the AT89S8253, and although it can't drive as much as an AVR, it can do 15mA/pin. It's got lots of pins, so you could cycle through all 7 * 12 = 84 segments. With a 5V supply and red LEDs with ~1.8 Vf, 220 Ohm resistors on the common segment would limit the current to 14.5mA. With a 1:84 duty cycle, the average current would be 0.17mA per segment.

author: dannyf
author_rank: Super Contributor
timestamp: March 07, 2015, 02:59:37 am
content: QuoteOr go naked (without the current limiting resistors) if you don't mind current consumption.Modern LEDs are sufficiently bright above 1ma, so much so that your eyes can barely see any difference between 1ma and 10ma.

author: ralphd
author_rank: Frequent Contributor
timestamp: March 07, 2015, 03:16:47 am
content: Quote from: dannyf on March 07, 2015, 02:59:37 amI wouldn't do that without checking the output drive characteristics first. If the output drive is ~25 Ohm, a bug in the program that leaves a segment on would put 120mA through pin rated for 15mA, possibly burning it out.At least for testing I'd use the current limiting resistors.Another option would be enabling brown-out reset on the MCU if it supports it. An LED left on would cause Vcc to drop, and trigger brown-out reset.