74138 family choice?

I'd like to use two 74138 3:8 decoders (wired into a 4:16 decoder) to control 16 rows of LEDs via logic level P channel MOSFETs. Does it matter if I use a 74hc138, 74hct138, 74ac138, etc.? Would there be any benefit in redoing the circuit to use 74238s and N channel MOSFETs?

Thanks as always.

I believe that '138 style encoders only have 1 pin true at a time, meaning you'll need to continually scan the Leds, You might be better off using 8-bit latches instead.

I’d go with shift register like TPIC6B595, can take high voltage & high current, fewer control lines needed than using two 74138’s also.
87 cents at avnet.com
Use them to pull cathodes low.
Or, use them to pull P-channel gates low with resistor to +12 or whatever your high side voltage is to turn the p-channel off as shown below.

OK, quick family survey:

TTL or LS TTL (ie 74xx or 74LSxx) - ancient, fast, power hungry, only works at 5V, low noise margin. Don't use if can be helped. HC - ie 74HCxx - fast, works from 2V to 6V, low power, good noise margin, good general choice. HCT - ie 74HCTxx - fast, only works at 5V, low power, has TTL compatible threshold voltage (low noise margin), but will work with 3.3V inputs AC - ie 74ACxx - fast, low power, tolerates higher voltage inputs than the power rail. 2..6V I think. 4000 CMOS (ie CD4xxx) - very slow, 3V to 15V supply!, low power, very low output drive (less than 1mA at 5V IIRC).

HC family is a good all-round choice, will work at 3V3 as well as 5V, good output drive, fast, low power, cheap...

While I agree with the above statements, none of them actually answer the OP's original question.

To answer that...

The HC, HCT, etc refer to the internal workings of the chip and how they are constructed. You don't need to know those as such, only the knock-on effect.

Which is the differences in what is known as the "Static Discipline". This is the set of voltage levels used for input and output logic values. You can get these from the data sheet for the device. Unless you have specific logic level requirements that are out of the ordinary, then you don't need to worry overmuch about them.

In general, the Arduino itself is very close to HC (High-voltage CMOS [i.e., 5v]). The HCT is a "TTL" version of the HC, which has fixed voltage levels for the input logic HIGH (among other things) that make it useful for use in mixed voltage circuits (as level shifters, etc). LS is Low-powered shottky. Read the data sheets for the differences.

But yes, specific LED driving buffer chips would be far better.

Thanks everybody for your comments. @MarkT that was a great table of info; @CrossRoads thanks for the TPIC6B595 idea, I just ordered some to evaluate.

I apologize for not being clear enough. The project is really a 24x16 LED matrix. 3 TLC5916s control the column cathodes and a 4:16 decoder made from 2 74AC138s connected to 16 P-channel logic level MOSFETs control the row anodes. I drive the LEDs @ 100 mA each to compensate for them only being on 1/16th of the time (the spec sheet says it’s OK to drive them up to 120 mA if the pulse is < 0.1ms; I’m updating @ 50 KHz so no problem there).

When I run the entire circuit at 5V everything works but the LEDs aren’t spectacularly bright. When I run the LEDs at 12V they’re bright enough, but I get ghosting on the rows.

When I originally posted yesterday I though the problem was the 74AC138s not switching the MOSFETs off fast enough, but after a night of research now I think it may be capacitance decay in the MOSFETs (not sure if I’m using the correct term). Currently their gates are connected directly to the pins of the '138s and other posts here etc. suggest I need a pull up/down resistor to fix the ghosting.

Since I’m using a P-channel MOSFET this would mean I’d have to use a pullup to 12V? Wouldn’t that voltage propagate backwards and hurt the 74AC138?

Alternatively, I could redesign using 74HC238s (non-inverting version of the 74138) and use N-channel logic level MOSFETs with a pulldown resistor to ground, would that be a better way to go?

TPIC6B595 can be used with pullup to 12V (or 50V even) to turn off MOSFET and can sink large currents low to turn on the MOSFET.

Which P-channel mosfets are you using - in particular, are they meant for 5V gate drive, and do they have a low enough Rds(on) at 1.6A drain current? 50KHz is a high multiplexing frequency and depending on the mosfet, they might be a little slow turning on and off when driven from a 74AC138.

The TLC5916s need about 1V on the output pins to function correctly, leaving 4V for the LED and mosfet. Do you know what the voltage drop of the LED is @ 100mA?

Which P-channel mosfets are you using - in particular, are they meant for 5V gate drive, and do they have a low enough Rds(on) at 1.6A drain current? 50KHz is a high multiplexing frequency and depending on the mosfet, they might be a little slow turning on and off when driven from a 74AC138.

I'm using these:

http://www.digikey.com/product-detail/en/IRLML2246TRPBF/IRLML2246TRPBFCT-ND/2639576

I think drain current would be 2.4A (24 LEDs @ 100 mA ea), if I'm reading the spec sheet right Figure 13 says Rds(on) for 2.4A would be about 100 m Ohm?

The TLC5916s need about 1V on the output pins to function correctly, leaving 4V for the LED and mosfet. Do you know what the voltage drop of the LED is @ 100mA?

Here's the spec sheet for the LEDs:

http://www.us.kingbright.com/images/catalog/SPEC/APT3216SYCK.pdf

The charts don't show anything above 50mA in but by extrapolating I think would be 2.5 - 3 V?

There is also the '154 series of 4 line to 16 line decoders.

CrossRoads: TPIC6B595 can be used with pullup to 12V (or 50V even) to turn off MOSFET and can sink large currents low to turn on the MOSFET.

Do you mean replace the 74AC138s with TPIC6B595s, keep the existing MOSFETs, and add a pullup resistor (10K?) from drain to gate on each MOSFET?

KeithRB: There is also the '154 series of 4 line to 16 line decoders.

Thanks for that chip, if it turns out I'm just using the wrong MOSFETs I may redesign to use it & simplify the circuit.

magagna:

Which P-channel mosfets are you using - in particular, are they meant for 5V gate drive, and do they have a low enough Rds(on) at 1.6A drain current? 50KHz is a high multiplexing frequency and depending on the mosfet, they might be a little slow turning on and off when driven from a 74AC138.

I'm using these:

http://www.digikey.com/product-detail/en/IRLML2246TRPBF/IRLML2246TRPBFCT-ND/2639576

I think drain current would be 2.4A (24 LEDs @ 100 mA ea), if I'm reading the spec sheet right Figure 13 says Rds(on) for 2.4A would be about 100 m Ohm?

No, they have Rds(on) of 54 milliohms at 5V gate drive, so will dissipate about 300mW max. Use 150 ohm gate resistors and they should switch in about 300ns, should be fast enough.

Use 150 ohm gate resistors

Do you mean a resistor between the output pin of the 74AC138 and the gate pin of the MOSFET?

Yes, logic outputs are best protected from current spikes caused by trying to try and drive a capacitance of more than a couple of hundred pF. power MOSFET gates are very capacitive.

Do you mean replace the 74AC138s with TPIC6B595s, keep the existing MOSFETs, and add a pullup resistor (10K?) from drain to gate on each MOSFET?

That's exactly what I mean.

I'm updating @ 50 KHz so no problem there

So you need to send 2 bytes to the shift register every 20uS? You have 320 clocck cycles to get an update out.

Thank you MarkT and CrossRoads for the circuit ideas. I'll try them out as soon as possible.

So you need to send 2 bytes to the shift register every 20uS? You have 320 clocck cycles to get an update out.

That's correct, the interrupt routine runs every 320 ticks. It's very small; all it does is update the display. It flips some bits, SPI.transfer() x 3 out of an array, flips a few more bits, and increments the row counter for next time. The main loop is responsible for the animations and yes it's definitely slowed down by the interrupt routine firing so often but I still need to add delay()s once in a while so ultimately all is well.

In case you're wondering about 50 Khz -- it's 16 rows x 32 levels of PWM x 100 Hz so you can't see the multiplexing flicker.

I'll post an update after I get things working.

magagna: I'm using these:

http://www.digikey.com/product-detail/en/IRLML2246TRPBF/IRLML2246TRPBFCT-ND/2639576

I think drain current would be 2.4A (24 LEDs @ 100 mA ea), if I'm reading the spec sheet right Figure 13 says Rds(on) for 2.4A would be about 100 m Ohm?

The figure you can rely on is 135mohm max @ Vgs=4.5V Ids=-2.6A. So you can assume no worse than 135mohm @ 2.4A, giving 0.324V worst case voltage drop.

magagna: Here's the spec sheet for the LEDs:

http://www.us.kingbright.com/images/catalog/SPEC/APT3216SYCK.pdf

The charts don't show anything above 50mA in but by extrapolating I think would be 2.5 - 3 V?

Yes, it looks like around 2.5V @ 100mA to me. So 5V should be more than enough.

A few more questions:

  1. Are you using 180 ohm Rext on each TLC5916?

  2. What 5V power supply are you using? Have you measured its output when all the LEDs are on?

  3. Do you have a 0.1uF or greater decoupling capacitor local to each TLC5916?

  4. Have you tried a lower multiplexing frequency, say 10KHz?

btw if you run the setup from 12V then you will dissipate far too much power in the TLC5916s, and I would expect the overtemperature detection will trip in very quickly when you are lighting all the LEDs. Even at 5V, the voltage at their outputs when they are sinking 100mA could be more than 2V, at which the dissipation in each would be 1.6W.

  1. Are you using 180 ohm Rext on each TLC5916?

  2. What 5V power supply are you using? Have you measured its output when all the LEDs are on?

  3. Do you have a 0.1uF or greater decoupling capacitor local to each TLC5916?

  4. Have you tried a lower multiplexing frequency, say 10KHz?

I am indeed using a 180 ohm resistor on the TLC5916s when I run everything at 5 V. The adapter I use for those tests is a 5 V 4 A switching wall adapter; my meter says it's at about 2.2 A when all LEDs are on full brightness.

I do have 0.1uF cap near all TLC5916s (and all other chips). I have a 220uF cap next to the incoming power supply and when I'm using a 12 V power supply I have a 10uF cap next to the voltage regulator (LD1117S50TR) per its data sheet. If you have any other recommendations I would welcome any input.

I haven't tried lower multiplexing frequencies, that will require reworking some of the code, but I will try that out this weekend as well.

btw if you run the setup from 12V then you will dissipate far too much power in the TLC5916s, and I would expect the overtemperature detection will trip in very quickly when you are lighting all the LEDs. Even at 5V, the voltage at their outputs when they are sinking 100mA could be more than 2V, at which the dissipation in each would be 1.6W

Thank you, I hadn't considered that. So far I had just been staying under the 960mA limit of the chips; I hadn't looked at wattage limits.

After a day of testing I think the problem is the TLC5916s and not the 74AC138 3:8 decoders or the MOSFETs at all.

If I run the interrupt routine at 50Khz with no TLC5916 commands (so all it's doing is switching from one MOSFET to the next) the circuit uses only 1% less current than displaying a single row with no updates.

I added 150 ohm resistors on the gate pins and it didn't seem to make a difference one way or the other, but I'm going to leave them in the design because I trust MarkT more than I trust myself.

Once I started adding the TLC5916s code back in I saw the current drop off. Just adding the code that pulses the Output Enable pin reduces brightness about 8% and the SPI and latch code reduces it another 14%. When I increased the amps by reducing the RExt resistors I saw even more dropoff, this non-linear dropoff explains why I'm seeing the LEDs only pulling 57mA on average instead of 100mA.

My guess is the TLC5916s do their constant-current-regulation thing by starting out with low current and slowly ramping up, and my pulsing them so fast gives them less time to figure things out.

All these tests were at 5V; now that I know where the problem is I believe I can safely test higher voltages (as long as I stay within the thermal limits of the chips), knowing the problem isn't the decoders or MOSFET selection.

Thanks to everybody for your input.