Author Topic: How to control 12 seven segment digits  (Read 10881 times)

0 Members and 1 Guest are viewing this topic.

Offline jkl12Topic starter

  • Newbie
  • Posts: 4
How to control 12 seven segment digits
« on: March 03, 2015, 11:19:34 am »
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
 

Offline BradC

  • Super Contributor
  • ***
  • Posts: 2104
  • Country: au
Re: How to control 12 seven segment digits
« Reply #1 on: March 03, 2015, 11:25:00 am »
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.

You'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).
 

Offline Kjelt

  • Super Contributor
  • ***
  • Posts: 6459
  • Country: nl
Re: How to control 12 seven segment digits
« Reply #2 on: March 03, 2015, 12:27:18 pm »
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.
 

Offline mij59

  • Frequent Contributor
  • **
  • Posts: 693
  • Country: nl
Re: How to control 12 seven segment digits
« Reply #3 on: March 03, 2015, 12:36:42 pm »
Search on eBay for the  TM1638 or TM1640.
Here's a review of the TM1638,
 

Offline jkl12Topic starter

  • Newbie
  • Posts: 4
Re: How to control 12 seven segment digits
« Reply #4 on: March 03, 2015, 12:50:01 pm »
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.

Both those are for common cathode displays I think. Are there equivalents for common anode?
 

Offline AndreasF

  • Frequent Contributor
  • **
  • Posts: 251
  • Country: gb
    • mind-dump.net
Re: How to control 12 seven segment digits
« Reply #5 on: March 03, 2015, 12:57:03 pm »
How about a series of (SIPO) shift-registers, e.g. one for each digit?
my random ramblings mind-dump.net
 

Offline BlueBill

  • Regular Contributor
  • *
  • Posts: 169
  • Country: ca
Re: How to control 12 seven segment digits
« Reply #6 on: March 03, 2015, 01:22:27 pm »
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.
 

Offline Kjelt

  • Super Contributor
  • ***
  • Posts: 6459
  • Country: nl
Re: How to control 12 seven segment digits
« Reply #7 on: March 03, 2015, 03:20:12 pm »
Both those are for common cathode displays I think. Are there equivalents for common anode?
There 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?
 

Offline jkl12Topic starter

  • Newbie
  • Posts: 4
Re: How to control 12 seven segment digits
« Reply #8 on: March 03, 2015, 03:25:14 pm »
Both those are for common cathode displays I think. Are there equivalents for common anode?
There 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?
The 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
 

Offline westfw

  • Super Contributor
  • ***
  • Posts: 4196
  • Country: us
Re: How to control 12 seven segment digits
« Reply #9 on: March 04, 2015, 06:08:42 am »
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.
 

Offline jkl12Topic starter

  • Newbie
  • Posts: 4
Re: How to control 12 seven segment digits
« Reply #10 on: March 04, 2015, 12:40:19 pm »
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.

This 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?
 

Offline Rolo

  • Regular Contributor
  • *
  • Posts: 206
  • Country: nl
Re: How to control 12 seven segment digits
« Reply #11 on: March 04, 2015, 03:11:50 pm »
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.
« Last Edit: March 04, 2015, 05:53:36 pm by Rolo »
 

Offline slburris

  • Frequent Contributor
  • **
  • Posts: 542
  • Country: us
Re: How to control 12 seven segment digits
« Reply #12 on: March 04, 2015, 05:03:24 pm »
How about the TC62D748CFNAG?  About $1 in single qty, you would need 1 per
2 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=TC62D748CFNAG

There are many many workalike chips in the space, e.g. CAT4016

Some are a harder to buy than others.

Scott
 

Offline Howardlong

  • Super Contributor
  • ***
  • Posts: 5315
  • Country: gb
Re: How to control 12 seven segment digits
« Reply #13 on: March 04, 2015, 05:34:57 pm »
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.

For 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.
 

Offline mikerj

  • Super Contributor
  • ***
  • Posts: 3233
  • Country: gb
Re: How to control 12 seven segment digits
« Reply #14 on: March 05, 2015, 03:59:31 pm »
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.
 

Offline BlueBill

  • Regular Contributor
  • *
  • Posts: 169
  • Country: ca
Re: How to control 12 seven segment digits
« Reply #15 on: March 05, 2015, 05:03:52 pm »
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.
 

Offline neslekkim

  • Super Contributor
  • ***
  • Posts: 1305
  • Country: no
Re: How to control 12 seven segment digits
« Reply #16 on: March 05, 2015, 08:07:57 pm »
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.

Where 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 types :)
Farnell doesn't seem to stock this kind
 

Offline westfw

  • Super Contributor
  • ***
  • Posts: 4196
  • Country: us
Re: How to control 12 seven segment digits
« Reply #17 on: March 06, 2015, 12:33:32 am »
Quote
What's wrong with muxing the segments so you have a 1:8 duty?
An interesting idea.  The software side would be annoying; you would have to decode all 12 digits in parallel.
 

Offline BlueBill

  • Regular Contributor
  • *
  • Posts: 169
  • Country: ca
Re: How to control 12 seven segment digits
« Reply #18 on: March 06, 2015, 05:00:00 am »
Quote
What's wrong with muxing the segments so you have a 1:8 duty?
An interesting idea.  The software side would be annoying; you would have to decode all 12 digits in parallel.

At 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.
« Last Edit: March 06, 2015, 05:01:59 am by BlueBill »
 

Offline dannyf

  • Super Contributor
  • ***
  • Posts: 8221
  • Country: 00
Re: How to control 12 seven segment digits
« Reply #19 on: March 06, 2015, 01:42:28 pm »
Quote
I can use up to 2 of the uC ports to control them all.

You 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.
================================
https://dannyelectronics.wordpress.com/
 

Offline Rolo

  • Regular Contributor
  • *
  • Posts: 206
  • Country: nl
Re: How to control 12 seven segment digits
« Reply #20 on: March 06, 2015, 05:33:53 pm »
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.

Where 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 types :)
Farnell doesn't seem to stock this kind

In 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.
 

Offline Rolo

  • Regular Contributor
  • *
  • Posts: 206
  • Country: nl
Re: How to control 12 seven segment digits
« Reply #21 on: March 06, 2015, 06:25:27 pm »
Update : Found the DIP version of the WS2803 on http://www.aliexpress.com just do a search on "WS2803 DIP".

 

Offline neslekkim

  • Super Contributor
  • ***
  • Posts: 1305
  • Country: no
Re: How to control 12 seven segment digits
« Reply #22 on: March 06, 2015, 07:29:15 pm »
Update : Found the DIP version of the WS2803 on http://www.aliexpress.com just do a search on "WS2803 DIP".

Great, found it there.
 

Offline ralphd

  • Frequent Contributor
  • **
  • Posts: 445
  • Country: ca
    • Nerd Ralph
Re: How to control 12 seven segment digits
« Reply #23 on: March 07, 2015, 02:48:29 am »
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.
Unthinking respect for authority is the greatest enemy of truth. Einstein
 

Offline dannyf

  • Super Contributor
  • ***
  • Posts: 8221
  • Country: 00
Re: How to control 12 seven segment digits
« Reply #24 on: March 07, 2015, 02:59:37 am »
Quote
220 Ohm resistors on the common segment

Or 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.
================================
https://dannyelectronics.wordpress.com/
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf