Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Adjusting brightness of 7 segment LED.

Status
Not open for further replies.

maniac84

Full Member level 6
Joined
Mar 4, 2012
Messages
337
Helped
1
Reputation
2
Reaction score
1
Trophy points
1,298
Activity points
3,661
Hi guys,
I've read a related topic discussing about adjusting LED brightness from this forum: https://www.edaboard.com/threads/238311/
For my design, I'm designing a 7 segment common anode LED display driven by TPIC6C595. If my mcu produce a PWM signal, where is it connected to on the TPIC6C595?
Or is there any other way to adjust the brightness using mcu without using PWM?
 

You would connect the PWM output to the /G (pin 8) of the TPIC6C595. If you look at the logic diagram of the TPIC6C595 (page 2 here http://www.ti.com/lit/ds/symlink/tpic6c595.pdf ) then you will see that this will enable/disable all the outputs simultaneously.

I see. I never thought of controlling the brightness using PWM on the /G pin. It really can work?
I found this website: http://www.ermicro.com/blog/?p=844
They use a transistor which input a PWM signal to control the brightness. Just want opinion, is this better or controlling the /G pin is better?
 

It should work but if you are constantly clocking data into the IC, be careful not to get strobing effects between the PWM signal and the clock signal.

Brian.
 

It should work...
Brian.

Which design do you mean? Which one should work?

---------- Post added at 16:52 ---------- Previous post was at 16:13 ----------

Is there any other way to control the brightness using mcu without using PWM?
 

Using a transistor to switch the LED commons is the other way to do it - if you were driving the LED segments through an IC which did not have a global enable control, then that way would be the method to choose.

Since your design does have an enable, then you can use either method. Utilising the enable pin is simpler (no extra components).

Either method could suffer from the strobing effect mentioned by betwixt. It is caused (or could be) by the difference in frequency between the PWM on/off and the segment write speed, causing a sort of beat frequency that is slow enough to see as a variation in brightness across the LED. You could calculate the timings to avoid this, or just see if it happens and adjust the timings slightly if it does.
 
All of them.
There are several ways to vary the brightness but only two underlying methods, 1 - vary the current through the LEDs and 2 - vary how long each is lit up for. Human vision doesn't have a very fast response time to rapid changes and perceives the duration of light to be a different brightness.

If you use the analog method of controlling the current you face a potential problem because the current drawn by each DIGIT depends on the number of SEGMENTS lit up on it. So just controlling the current to the common anode or cathode connection means the brightness will be lower as more segments are turned on, this may not be a problem and this method is used in a lot of systems. Ideally you would control the current in each individual segment drive circuit. You can decide the current using either a DAC circuit or by filtering a PWM signal.

There are two digital methods, the first is to control the 'off' period between each digit operating. There is normally a short pause between one digit switching off and the next switching on, this is to allow time for the residual current in the LED and driver to fall to zero and prevent 'ghosting' on adjacent digits. If the 'off' period is made longer the time the LED is actually producing light is shorter and it looks dimmer even though it is running at full current. To control the inter-digit blanking you either have to have access to the workings of the driver circuit or you have to synchronize the data written to the segments to the digit switching signal.

The second digital method is far easier to work with but has a serious drawback. This is the method used in the example schematics in the links above. What you do is drive the LEDs at normal full brightness but rapidly chop the supply to them so they spend some time working and some without power. You vary the relative time they are on and off to control the brightness. This is the pure PWM method and requires little more than a PWM signal and a switching transistor. Many microcontrollers can produce PWM signals from their on-board timers so all you have to do is set the pulse width and the silicon does the rest for you. The drawback I warned about is that if you are multiplexing the LEDs and each is switched on in sequence, if the PWM frequency isn't carefully chosen, you may get a situation where the PWM chopping and the sequencing of the digits cause a flicker or strobing effect. For example, you might find that the PWM turned the LEDs off during one whole step in the sequence and one digit didn't light up at all. normally you get around this by making the PWM period much shorter than the time the LED is selected.

Brian.
 
There are two digital methods, the first is to control the 'off' period between each digit operating. There is normally a short pause between one digit switching off and the next switching on, this is to allow time for the residual current in the LED and driver to fall to zero and prevent 'ghosting' on adjacent digits. If the 'off' period is made longer the time the LED is actually producing light is shorter and it looks dimmer even though it is running at full current. To control the inter-digit blanking you either have to have access to the workings of the driver circuit or you have to synchronize the data written to the segments to the digit switching signal.

The second digital method is far easier to work with but has a serious drawback. This is the method used in the example schematics in the links above. What you do is drive the LEDs at normal full brightness but rapidly chop the supply to them so they spend some time working and some without power. You vary the relative time they are on and off to control the brightness. This is the pure PWM method and requires little more than a PWM signal and a switching transistor. Many microcontrollers can produce PWM signals from their on-board timers so all you have to do is set the pulse width and the silicon does the rest for you. The drawback I warned about is that if you are multiplexing the LEDs and each is switched on in sequence, if the PWM frequency isn't carefully chosen, you may get a situation where the PWM chopping and the sequencing of the digits cause a flicker or strobing effect. For example, you might find that the PWM turned the LEDs off during one whole step in the sequence and one digit didn't light up at all. normally you get around this by making the PWM period much shorter than the time the LED is selected.

Brian.
Let me get it clear. Is the first digital method means to connect PWM signal to OE of TPIC6C595? And is the second digital method means to input the PWM signal to a transistor and use the transistor to control the current to the led?
 

Not quite, what you describe is using PWM to enable or disable the TPIC6C595 buy using it's Output Enable pin or doing exactly the same with a transistor in the supply line. One is a low side switch, the other a high side switch but they do exactly the same thing.

The first method I stated is to control the data to the LED segments so they are all off for longer during each digits drive period. It requires some software to either blank or drive the segments and hence adjust their perceived brightness. So it's a software rather than hardware solution. You have to set the on/off drive to the segments in conjunction with selecting the clock signal to the driver IC.

There is another option, to control the delay between the clock signal and the OE signal so that the digit is off for longer after the drive signal is applied.

Brian.
 

Not quite, what you describe is using PWM to enable or disable the TPIC6C595 buy using it's Output Enable pin or doing exactly the same with a transistor in the supply line. One is a low side switch, the other a high side switch but they do exactly the same thing.

The first method I stated is to control the data to the LED segments so they are all off for longer during each digits drive period. It requires some software to either blank or drive the segments and hence adjust their perceived brightness. So it's a software rather than hardware solution. You have to set the on/off drive to the segments in conjunction with selecting the clock signal to the driver IC.

There is another option, to control the delay between the clock signal and the OE signal so that the digit is off for longer after the drive signal is applied.

Brian.
Wow... really quite complicated after reading your post.
I think I'll use the PWM to control the OE on TPIC6C595 to control the brightness.

---------- Post added at 19:09 ---------- Previous post was at 18:12 ----------

The first method I stated is to control the data to the LED segments so they are all off for longer during each digits drive period. It requires some software to either blank or drive the segments and hence adjust their perceived brightness. So it's a software rather than hardware solution. You have to set the on/off drive to the segments in conjunction with selecting the clock signal to the driver IC.

Brian.
Is the blank or drive, on or off drive refer to the OE pin?
 

Lets go back to basics first.

How do you drive the segments?
How do you have the TPIC6C595 connected to the 7-segment LEDs?
Do you understand what PWM actually is?

I don't mean to belittle your abilities, I'm just trying to pitch a tutorial at the right level to help you.

Brian.
 

Lets go back to basics first.

How do you drive the segments?
How do you have the TPIC6C595 connected to the 7-segment LEDs?
Do you understand what PWM actually is?

I don't mean to belittle your abilities, I'm just trying to pitch a tutorial at the right level to help you.

Brian.
I drive my segment by connecting each segment to the output pin of TPIC6C595. There's 8 output drain pin on TPIC6C595 each connect to 8 segments of the led. And from the mcu, I just connect 3 pins which is the data signal, clock signal and the latch signal to TPIC6C595 for it to drive the led.
As for PWM, it is just turning on and off the output signal in a very fast period that human eyes can't detect. If my turning on time is more than turning off time, then the led will be brighter. If my turning off time is more than turning on time, the led will be dim. Am I right?
 

Another thing is, what if my mcu only produce a 3.3V PWM but the TPIC6C595 require a 5V signal? Can I input my PWM signal to a 74LVX3245 to output a 5V PWM signal?

---------- Post added at 11:54 ---------- Previous post was at 10:37 ----------

Someone suggest to me that we can use a DAC like the MCP4725 to control the led brightness. Can it be done? This DAC only output voltage up to 5V only, but my 7 segment LED must use 12V. Is there any DAC which can output 12V?
 
Last edited:

You are probably wiring it the opposite way around to the way it is normally done. How big is the 7-segment LED, it seems you need to capability to drive more than 1 Watt per segment which is much higher than normal displays need. Is it a single digit or part of a bigger display and how big is it? Can you give a part number for the display so I can check it's data sheet.

Brian.
 

I don't have the datasheet.
My 7 segment is around 5.5 inch. So I think 12V is typical. It is a single digit.
 

Another thing, my mcu is producing 3.3V signal, can I straightaway connect the serial data, clock and latch to TPIC6C595? Or I need a level shifter to make the signal to 5v?
 

I'm considering using TLC5916 as the led driver too. Do you guys know what is the difference between TLC5916 and TPIC6C595?
 

You guys suggest me earlier that I can input the PWM signal from the mcu to the OE of the TPIC6C595 to use PWM to control the brightness.
Now, if I'm not using the TPIC6C595 driver and I connect directly the LED to the IO pins of the MCU. 7 segments need 7 IO pins. So how do I control using PWM? Can all the signal from the IO become PWM signal?
I've found a project website (**broken link removed**) which they connect directly the LED to the mcu but still using PWM to control. I'm wondering how do they do it? Is it all of the IO pins can produce PWM signal?
 
Last edited:

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top