EmbeddedRelated.com
Forums

Limiting slew rate (PIC driving LEDs)

Started by Jim March 5, 2004
Steve at fivetrees wrote:
> "Jim" <jim@nospam.com> wrote in message > >> I'm driving three 7-segment LED displays (Agilent HDSP-7801) from a >> PIC16LF819 at 3.3V. I'm Charlieplexing the LEDs to minimize PIC pin >> count: http://www.maxim-ic.com/appnotes.cfm/appnote_number/1880 >> >> The PIC sets the drive lines to make one of the digits display. >> After 1ms it moves on to the next digit, etc. >> >> I would like to limit the skew rates of the drive lines to minimise >> EMI. > > EMI is a function of current. Capacitors to ground, on their own, > will increase transient current. Consider adding impedance to the > drive lines, and perhaps adding a few 10s of pFs to ground > downstream of the added impedance. Aim to limit drive trace > current spikes.
I've multiplexed displays since Nixies, but what in the devil is "Charlieplexing"? -- Chuck F (cbfalconer@yahoo.com) (cbfalconer@worldnet.att.net) Available for consulting/temporary embedded and systems. <http://cbfalconer.home.att.net> USE worldnet address!
On Sat, 06 Mar 2004 06:14:43 GMT, the renowned CBFalconer
<cbfalconer@yahoo.com> wrote:

>I've multiplexed displays since Nixies, but what in the devil is >"Charlieplexing"?
He's got a link to an explanation. It's a variation on a general method of multiplexing that allows you to drive more LEDs on n + m lines than n * m by driving port pins in both directions. In fact, if you're willing to drive only one LED at a time (which could be muxed fast so some or all appear to be on, of course), you can drive (k)*(k-1) LEDs with k port pins. Eg. 12 LEDs with only 4 port pins. You just connect them both ways across all possible combinations of pins, and use firmware that tristates all but the pair of port pins that are actually driving current through a given LED. The method Maxim uses allows you to use conventional digits (but NOT standard multiplexed displays) and drives 8 8-segment digits (64 LEDs) with 9 lines (less than the 72 possible), allowing all the segments in one digit to be on at once. If you are driving at high current, it's a technique with some real limitations, and I've only occasionally used the technique in real products. My stuff tends to have analog things going on.. it also mucks up the ability to share display driving lines with keypad scanning. Best regards, Spehro Pefhany -- "it's the network..." "The Journey is the reward" speff@interlog.com Info for manufacturers: http://www.trexon.com Embedded software/hardware/analog Info for designers: http://www.speff.com
"Mike Page" <mike@SCRUBeclectic-CAPSweb.BLAMEco.SWENuk> wrote in message
news:1078521425.390909@ananke.eclipse.net.uk...

<snip>

> Do you have a specific EMC failure that needs addressing ? > > In my experience there is a huge gulf between the emissions of kHz > systems (eg LED displays, chopper drives) and Mhz systems (eg clocks and > parallel buses) and whilst the former may have effects on local > measurement circuitry, usually little or no EMC control is needed to > meet CE regulations. > > -- > Mike Page BEng(Hons) MIEE www.eclectic-web.co.uk >
Hi Mike, Thank you for your post. It is reassuring to read that, in practice, there often is no problem with driving LEDs at the speeds we are doing so. This is my first consume product, and I'm getting paranoid about CE compliance requirements (required for sales in Europe - I'm based in UK). The seven-segment LEDs, and the PCB they sit on, are behind an aperture of 1.5" x 0.5" in an aluminium front panel. The PIC driving the LEDs is on another PCB (it has other jobs to do that need it at the rear of the unit). The PIC lines are connected to the dumb front panel PCB via 5" of IDC wire. My worry is, with unshielded cable like that, we could be generating EM emissions that will cause the unit to fail compliance regs. I wanted to minimise any potential problems in the design before we pay for it to be tested (and then retested if it fails, etc.). In practice then, these measures to limit slew-rate may well not be necessary, which would be great. Unfortunately I don't have any experience in the area to make that decision, so I'm thinking it is best to play it as safe as possible at this stage. Jim
"Spehro Pefhany" <speffSNIP@interlogDOTyou.knowwhat> wrote in message
news:qi4j40tbdahb2afag6v1lqctf7ui5ge1pd@4ax.com...
> On Sat, 06 Mar 2004 06:14:43 GMT, the renowned CBFalconer > <cbfalconer@yahoo.com> wrote: > > >I've multiplexed displays since Nixies, but what in the devil is > >"Charlieplexing"? > > He's got a link to an explanation. It's a variation on a general > method of multiplexing that allows you to drive more LEDs on n + m > lines than n * m by driving port pins in both directions. > > In fact, if you're willing to drive only one LED at a time (which > could be muxed fast so some or all appear to be on, of course), you > can drive (k)*(k-1) LEDs with k port pins. Eg. 12 LEDs with only 4 > port pins. You just connect them both ways across all possible > combinations of pins, and use firmware that tristates all but the pair > of port pins that are actually driving current through a given LED. > > The method Maxim uses allows you to use conventional digits (but NOT > standard multiplexed displays) and drives 8 8-segment digits (64 LEDs) > with 9 lines (less than the 72 possible), allowing all the segments in > one digit to be on at once. > > If you are driving at high current, it's a technique with some real > limitations, and I've only occasionally used the technique in real > products. My stuff tends to have analog things going on.. it also > mucks up the ability to share display driving lines with keypad > scanning. > > Best regards, > Spehro Pefhany > -- > "it's the network..." "The Journey is the reward" > speff@interlog.com Info for manufacturers:
http://www.trexon.com
> Embedded software/hardware/analog Info for designers:
http://www.speff.com For anyone who is interested, I'm not driving the decimal place of each digit so I'm driving 3 x 7 segments with 8 PIC pins. All the other I/O pins are used for other jobs so it seemed the most cost-effective way to drive the LEDs (larger PICs are quite a bit more money percentage-wise, from our suppliers anyway). Spehro's suggestion would only require 6 lines for the same job (actually up to 30 segments) That would be even better, but would brightness suffer maybe, with only one LED on at once? Jim
On Sat, 6 Mar 2004 11:03:30 -0000, the renowned "Jim" <jim@nospam.com>
wrote:
>For anyone who is interested, I'm not driving the decimal place of each >digit so I'm driving 3 x 7 segments with 8 PIC pins. All the other I/O pins >are used for other jobs so it seemed the most cost-effective way to drive >the LEDs (larger PICs are quite a bit more money percentage-wise, from our >suppliers anyway).
Yes, for some reason. Maybe it's Microchip's marketing strategy at work.
>Spehro's suggestion would only require 6 lines for the same job (actually up >to 30 segments) That would be even better, but would brightness suffer >maybe, with only one LED on at once?
Look at it this way. Your limitation on average current is the *digit* current. Say that is 15mA. You can thus drive 15mA/7 = 2.1mA/segment or 714uA per segment average. If you drive only one LED at a time at 15mA you'll get an average current of 15mA/21 = 714uA per segment, so the apparent brightness will be roughly the same. This current level is just sufficient for good displays such as this one (plug plug, but you can't mux them this way) that we sell: http://www.trexon.com/leds/trexon_led_display.pdf , but you're only getting a fraction of the potential brightness of course. Run them at 10-20mA average per segment and they are almost blinding by comparison. Unfortunately, the brightness is pretty much fixed by the display, given the PIC limitations. The big problem is that if you minimize it to 6 lines you'll not be able to use standard LED digits. Unless your quantities are truly humongous that is an unpleasant limitation, IMHO. Just getting a sample display or two would be an expensive hassle. Best regards, Spehro Pefhany -- "it's the network..." "The Journey is the reward" speff@interlog.com Info for manufacturers: http://www.trexon.com Embedded software/hardware/analog Info for designers: http://www.speff.com
"Jim" <jim@nospam.com> writes:

> This is my first consume product, and I'm getting paranoid about CE > compliance requirements (required for sales in Europe - I'm based in UK).
Most probably you won't face any problems associated with the LEDs. The frequencies are so low that EM emissions are small. The standard does not specify any radiated emission limits in the low-megahertz region. Only conducted emissions are measured, and your LEDs should not affect them any way. Radiated emission problems come from high-frequency clocks (e.g. a 50 MHz clock may be a problem at 150 MHz) and switcher power supplies.
> The PIC lines are connected to the dumb front panel PCB via 5" of IDC wire.
If you are still worried about the emissions, use twisted-pair IDC cable, where every signal is paired with GND. Twisted-pair cables radiate significantly less than non-twisted.
> In practice then, these measures to limit slew-rate may well not be > necessary, which would be great. Unfortunately I don't have any experience > in the area to make that decision, so I'm thinking it is best to play it as > safe as possible at this stage.
Then use ferrite/capacitor combination. Ferrite in series and capacitor to ground. The ferrite prevents current spikes and capacitors eat voltage spikes. You may either put a ferrite on each line (SMD ferrites are small) or use a clamp-on ferrite on the IDC. The latter is cheaper but less effective. But before using time and resources to this, have a good look at the signal shape with an oscilloscope. If there is no ringing, then it is very unlikely you'll be radiating anything significant. (Yes, EMC makes designers run in circles. On the wall, usually. EMC labs are full of worried-looking engineers :) - Ville -- Ville Voipio, Dr.Tech., M.Sc. (EE)
"Ville Voipio" <vvoipio@kosh.hut.fi> wrote in message
news:i3kbrna5g88.fsf@kosh.hut.fi...
> Radiated emission problems come from high-frequency clocks (e.g. > a 50 MHz clock may be a problem at 150 MHz) and switcher power supplies.
Forgive me, but this is a bit of an oversimplification. It would be perfectly true if we were dealing with sine waves. Hence the OP's (well-placed) concern with limiting edge rates. Steve http://www.fivetrees.com http://www.sfdesign.co.uk
"Steve at fivetrees" <steve@NOSPAMTAfivetrees.com> writes:

> "Ville Voipio" <vvoipio@kosh.hut.fi> wrote in message > news:i3kbrna5g88.fsf@kosh.hut.fi... > > Radiated emission problems come from high-frequency clocks (e.g. > > a 50 MHz clock may be a problem at 150 MHz) and switcher power supplies. > > Forgive me, but this is a bit of an oversimplification. It would be > perfectly true if we were dealing with sine waves. Hence the OP's > (well-placed) concern with limiting edge rates.
It is an oversimplification, true. Almost anything said on EMC (and especially EMI) is an oversimplification, unfortunately. (BTW, if you look at my numbers you quoted, they are not for a sinusoid :) Just a rough guesstimate for the application. The update frequency of the LEDs is 10 kHz. The worst-case signal is a perfect square wave, as there are only sharp odd harmonics. The radiated emissions are not measured below 30 MHz. Thus the first significant peak is at 30 010 000 Hz (3001st harmonic). Its amplitude is 2xVcc/(3001 x pi). This is equivalent to a 1 mV sinusoid at the same frequency. Hardly a problem when fed to a cable whose length is <<0.1 wavelength. Without significant inductances it is difficult to think of ways the low-frequency energy would be transformed into higher frequency energy, and there is very little of that high-frequency energy. The situation is dramatically different with faster signals, such as bus or clock signals. And by bad design (inadequate bypassing) it is possible to make the clock signal creep into the LED cable. This may be a problem, but it is unrelated to the LED signal transition rate. - Ville -- Ville Voipio, Dr.Tech., M.Sc. (EE)
On 06 Mar 2004 18:05:08 +0200, Ville Voipio wrote:

>Just a rough guesstimate for the application. The update frequency >of the LEDs is 10 kHz. The worst-case signal is a perfect square >wave, as there are only sharp odd harmonics.
I'm not clear why you say that's the "worst" case. Anything other than a "perfect" square wave (i.e. 50% duty cycle, infinite dV/dt) will radiate even harmonics as well as odd. While the even harmonics are typically much lower in power, they can be awkward if they happen to fall in the wrong place in the spectrum (say within a medical-telemetry band). -- Max
"Ville Voipio" <vvoipio@kosh.hut.fi> wrote in message
news:i3kllmermff.fsf@kosh.hut.fi...
> Just a rough guesstimate for the application. The update frequency > of the LEDs is 10 kHz. The worst-case signal is a perfect square > wave, as there are only sharp odd harmonics. > > The radiated emissions are not measured below 30 MHz. Thus > the first significant peak is at 30 010 000 Hz (3001st harmonic). > Its amplitude is 2xVcc/(3001 x pi). This is equivalent to a 1 mV > sinusoid at the same frequency. Hardly a problem when fed to a > cable whose length is <<0.1 wavelength.
Hmmm. I wasn't even really considering repeat rates; I was simply thinking in terms of a single sharp edge, parasitic capacitance and hence a current (and RFI) spike of indeterminate bandwidth - probably mostly related to track length. The repetitive nature of the signal makes it worse, of course, but to my way of looking at it the fundamental problem is the fast edge. I tend to be concerned about edge rates of *any* digital signal, no matter what the frequency. Perhaps I'm oversimplifying ;). Steve http://www.fivetrees.com http://www.sfdesign.co.uk