-2
\$\begingroup\$

I am intending to make a multiplexed LED matrix, possibly with 16 rows, 8 columns. This means maximum 16 LEDs (one full row) will be lit at the same time, thus 16 LEDs * 20 mA/LED = 320 mA.

According to the STM32F103 datasheet I have max 150 mA per GND, see excerpt below:

enter image description here

I use the development board (see pic below) which has 3 GND pins.

I assume I should split my LED 'returns' to 3 different GNDs to have a maximum of 150 mA/GND pin?

enter image description here

\$\endgroup\$
  • 1
    \$\begingroup\$ The current distribution within the device is unknowable; how do you intend to drive the LEDs? \$\endgroup\$ – Peter Smith Jan 8 at 12:48
  • 2
    \$\begingroup\$ If you need to have 150mA flowing through this microcontroller's ground then you're not designing this correctly. The current from the LEDs should not flow through the uC as it is unsuitable for that. You should use a LED driver IC or discrete transistors to switch the LED currents. The uC should only be driving those driver ICs / transistors. Even if the total LED current is below what the uC can handle, the high current and voltage drop in the uC might cause high power dissipation which will heat up the uC. \$\endgroup\$ – Bimpelrekkie Jan 8 at 12:52
  • \$\begingroup\$ @PeterSmith by using transistors, but than I thought it would be possible to drive the LEDs directly from the MCU. \$\endgroup\$ – Michel Keijzers Jan 8 at 13:09
  • \$\begingroup\$ @Bimpelrekkie Yes I realize that now too. I will use transistors and a separate power supply for the LEDs . \$\endgroup\$ – Michel Keijzers Jan 8 at 13:11
1
\$\begingroup\$

Do yourself a favor and set it up as 8 rows by 16 columns, with a common cathode per column. Then drive the data for column x from the board, with an appropriate current limit resistor per row, and use two TPIC6B595 (150mA sink current per output) or TPIC6C595 (100mA sink current per output) shift registers to sink the current for that column. Shift in a 1 to turn on an output. Hold a column on for 2mS, turn it off and send out data for the next column and turn on the next shift register output.

Or if you want to go the otherway, and drive 16 outputs from the board, use TPIC6A595 (350mA sink current per output) to sink the current for each row, one at a time again. Common cathode per row, and appropriate current limit resistor.

\$\endgroup\$
  • \$\begingroup\$ Thanks for this info, actually I thought it was doable without some drivers (just set the correct transistors at the right time). I want to 'simulate' 8 * 16 PWM LEDs (single color), but per row or column different colors. \$\endgroup\$ – Michel Keijzers Jan 8 at 13:13
  • \$\begingroup\$ Why can't I just use one GPIO for switching each column and each row directly from the MCU? With transistors like 2N7000 for both the column GPIOs and row GPIOs, thus 16 + 8 = 24 transistors/GPIOs ? I have enough free GPIOs on a STM32F103. \$\endgroup\$ – Michel Keijzers Jan 8 at 13:21
  • 1
    \$\begingroup\$ So, use 24 outputs to do what could be done with 11 or 12. Wire up 8 or 16 transistors and their base current limit resistors. TPICs have an output enable so the row or column could be PWMed. \$\endgroup\$ – CrossRoads Jan 8 at 13:22
  • \$\begingroup\$ Sounds good, just checked, the TPIC6A595 version is not in DIP format, but I probably can use 2 TPIC6B595 's too, than I make 16 columns (8 columns per TPIC6B595). I like to experiment to get PWM kind of output. Actually I was intending to do it 'directly' with a timer from the STM32 (very fast switching all transistors). \$\endgroup\$ – Michel Keijzers Jan 8 at 13:25
  • 1
    \$\begingroup\$ TPICs can support a lot more current Per output pin. 74HC595 is only rated for 70mA Absolute Max for the entire chip or risk damaging the individual IO pins or the VCC or Gnd pin. If 8 outputs on at once, that's just 8-9mA per output alowed vs 100-150-350mA per output. \$\endgroup\$ – CrossRoads Jan 8 at 16:29
3
\$\begingroup\$

These limits are typically the total current out of all GND pins simultaneously. The exact quote is:

Total current out of VSS ground lines: 150 mA

So yes, the total current out of these lines can not exceed 150 mA. Since you don't know which I/O goes to which GND, this would be impossible anyway.

You either need to add a bunch of transistors, or a dedicated LED driver, alternatively only light around 6-7 LEDs at a time.

If you use external transistors you can "overdrive" your LEDs. Most LED datasheet have figures for this, so even a plain old 20 mA-rated LED could be driven at 50, 100 or even 200 mA for a short time. This is typically used in situations just like this, when you want to multiplex a lot of LEDs but maintain a useful brightness.

\$\endgroup\$
  • \$\begingroup\$ Thanks for this info ... I know about overdriving LEDs, and I will test it if it is needed. \$\endgroup\$ – Michel Keijzers Jan 8 at 13:14
1
\$\begingroup\$

You should not draw more than 150ma from the whole chip totally or it blows up. What you need is a switch or some switches to supply the led chain. A low side switch can do fine but if you want something more reliable you can use constant current drivers which are controlled by a micro controller.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.