Multiplexing --- 7 Segment display's

Go To Last Post
23 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hello,

I am trying to multiplex four seven segment display.

At 1 MHz (ATMega8 with default fuses), this results in 10^6 / 256 / 8 = ~500 calls per second. Each call, we turn off one display, reconfigure the segments to light up, and turn on the other display. This results in ~125 Hz refresh rate.

Will it be fine :?:

Also what do we have to consider related to Track Length on PCB to avoid Deghosting effect :?:

Please reply.

Thanks.

//katoch

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Each multiplex is ~2ms.
Four displays means ~8ms to repeat the whole pattern i.e. 125Hz.

This will look fine. Anything above 40Hz should look ok too.

Build it and judge for yourself. Note that you can adjust your multiplex interrupt to any frequency. Just use CTC mode and the prescale bits, COMP interrupt instead of OVF interrupt.

Sensible wiring should be fine. You will need good 100nF decoupling capacitors on all VCC pins. And a good 470uF reservoir on the power supply.

David.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:
Also what do we have to consider related to Track Length on PCB to avoid Deghosting effect

Ghosting is a function of software implementation not track lengths... Ghosting can be removed by introducing delays between switching off one digit and switching on the next digit. (called interdigit blanking)

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

The ghosting problem arises when you either drive a new set of segments before you change the digit or the other way around. In the first case, there's a momentary write to the currently lit digit of the new digit, and in the second the new digit momentarily shows the previous value. Ideally, you want to change them both together but you can't do that for obvious reasons if your ports aren't wide enough...

The way to avoid it is, on your timer interrupt which selects the next digit:

- set the segment drive to 0x00
- select the next digit
- set the segment drive to the desired value.

This inserts the necessary (but very short) delay.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Ghosting depends also from the schematic.
If you use the digit driver transistors as emitter follower, then they switch very fast (no Miller effect)
and you get no ghosting.
Otherwise you may need additional delay in your software to compensate the Miller effect.

Peter

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

In our case we are using, Each multiplex is ~2ms ----i.e. we will immediately Turn Off one display & turn ON other.

Quote:
Ghosting can be removed by introducing delays between switching off one digit and switching on the next digit. (called interdigit blanking)
Means Once we have turned Off one display after 2 ms, we should not immediately Turn ON other. Instead wait for some time then Turn ON second display :?:

Quote:
If you use the digit driver transistors as emitter follower, then they switch very fast (no Miller effect) and you get no ghosting.

I will use it. Is this transistor ok BC558B :?:

Quote:
The way to avoid it is, on your timer interrupt which selects the next digit:
- set the segment drive to 0x00
- select the next digit
- set the segment drive to the desired value.
This inserts the necessary (but very short) delay.

Means, is we have to change from number 3 to 7 on one display--- then first make segment Off -- Then select new digit ---- Then set the new digit. Have i got right :?:

Thanks & regards,

//katoch

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

This chip attaches to SPI and takes care of all the multiplexing for you. And you need only one reference resistor, instead of one pr segment.
http://datasheets.maxim-ic.com/en/ds/MAX7219-MAX7221.pdf

"Maybe happiness is just fragments of existence with better packaging."

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:
I will use it. Is this transistor ok BC558B

That's a 100mA device, it depends on your displays whether that's enough or not. With 7 segments+DP the segment current limit is 12mA. You need some margin, so let's say 10mA.

Quote:
This chip attaches to SPI

That's some expensive chip, likely way more expensive than the MCU driving it. I see no real reason for using it.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

If you want your CPU cycles to chew on something else than muxing, I think it's a nice chip. It also takes considerably less space than whatever "manual" setup he might do. ;-)

"Maybe happiness is just fragments of existence with better packaging."

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Austria Microsystems AS1107 are even nicer...about half the price of MAX7219, plug in hardware and software compatibility - with a bit more functionality as well, if you wish. SOIC only though and not stocked everywhere

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

AS1107 is also good option.

Already there is discussion about comparison of both chips :---
http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1243196909

MAX7221 Speciication :----
http://www.maxim-ic.com/datasheet/index.mvp/id/1339

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

MAX7221 ;----
MAX7221 Distributor Cost
12$ -- from Distributor

AS1107 Distributor Cost
5$ -- from Distributor

For 1000 unit cost is almost 3 $.
http://www.ams.com/eng/Products/...(oi)/1

Last Edited: Fri. Jun 22, 2012 - 08:30 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

But Mega-8 will cost for only -- 1$, thats why i am going for it.

Quote:
That's a 100mA device, it depends on your displays whether that's enough or not. With 7 segments+DP the segment current limit is 12mA. You need some margin, so let's say 10mA.
Means One 7 segment display need maximum 12 ma :?:

Quote:
And a good 470uF reservoir on the power supply.

Actually i will be powering it from my micro-controller board. Shall i use separate power for LED 7- segment display or same will be enough :?:

Open Source Project - AVR freaks
Shall i use ULN2003 as shown in following circuit, what is need of ULN2003. Can we not work without it :?:

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Regarding driver chips or AVRmega8.

7-segment LED displays work pretty well in bright light. However you may need hefty currents.

Bear in mind that N displays will have a peak segment current of N x average and a peak common (digit) current of N x 8 x average. Think what happens when you display "8.8.8.8."

In practice this means you always need ULN2003 digit drivers. You will probably manage with the AVR driving the segments. e.g. 5mA average segment current implies GPIO current of 20mA per pin. 160mA per AVR.

If you only have 1mA average segment current, the AVR can drive segments and digits. OTOH it is not bright. An LCD may be a better option in strong light.

The MAX72219 or 7221 can manage far larger currents and are simple to interface to an AVR.

David.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

If it's practical to power it from another source, do so.
You could use the ULN or you could also use the UDN2981 etc. You need some resistors/resistor array in series.

EDIT: Or just go with the MAX7221 (slew rate limited). I hooked one up yesterday, it's super simple!

"Maybe happiness is just fragments of existence with better packaging."

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

@hanemagne

How is the performance of AS1107 ? Have you used it :?:

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

How is the performance of AS1107 ? Have anyone used it :?:

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

How do I measure the performance of an led driver chip? If I see numbers on the display and they arent flickering, is the performance is acceptable?

Imagecraft compiler user

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:

is the performance is acceptable?

Well I'd put an ammeter in circuit with any AVR pin being used and make sure you aren't exceeding any specified limits at any point in the display cycle.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

@katochd46: Never tried it, have no idea.

"Maybe happiness is just fragments of existence with better packaging."

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Max 7221 versus AS1107 Led Matrix Chips

I have used the MAX7219 / MAX7221 chips. They are excellent. Especially since you probably want the display in a remote position.

Since the AS1107 is cheaper but equivalent, I would give it a go.

Remember with all of these drivers. They default to max intensity "8888888" which takes serious current.

I suggest that you periodically reset the intensity. I turn it off when there has been user inactivity.

You have never described what brightness / power you actually want. A 4-digit dev board in subdued lighting works fine with an AVR i/o pins. 8-digit starts needing extra driver chips.

David.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

In an application that uses more than two digits, I recommend using a back-lighted LCD display instead of LED 7-segment displays. This is especially true if you are not using a custom printed-circuit board and are wiring the prototype by hand. Wiring LED 7-segment displays is a LOT of work. Finding why a single segment isn't lighting is no fun either.
On eBay, an 8x1 LCD module cost only about $5-10 with shipping and only needs six wires between the AVR and LCD module. If the backlight is not used, the LCD will use only a small fraction of the current of the LED cluster. LED displays are good if the display is only numeric, has to be read quickly, and could be a distance of 3-10 meters from the viewer. (Or if your teacher insists that you do the homework project with LEDs). If the user is going to be 2 meters or less from the display, then a large character LCD module is the way to go.
Here on AVRfreaks, everyone gives the answer to the appropriate to the hardware listed by the message poster. But I will assume that there will be some flexibility in the hardware and try to suggest the easiest approach to the application. Simpler is always better with microcontrollers because it always takes much longer than anticipated to get the application running.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I agree with your reasoning, but one of the MAX7221's strengths is that the protocol is so simple. Also, it requires only three pins at the MCU, whereas e.g. an HD44780 setup would require at least twice as many pins and more CPU time.

"Maybe happiness is just fragments of existence with better packaging."

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:
I suggest that you periodically reset the intensity. I turn it off when there has been user inactivity.
What do you mean by periodic inactivity :?:

I need to transfer counter value from one end to other end of RS-485 cable where there is a display unit. Now how should i decide when to turn display unit off or change its intensity :?:

counter ------------RS-485 -------------> Display

Thanks & Regards,
katoch