This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

nrf52 GPIO sink & source current

Hi, I'm contemplating ways to drive a small RGB LED matrix with the nrf52832 in a really space-tight project. Ideally without any external components. I'ts maybe around 40 RGBs (5x8 grid, 120 individual LEDs to drive).

Charlieplexing would be best regarding IO pin count, but it does limit the color-mixing options, along with other issues such as different voltage drops for the R, G & B LEDs.

Standard matrix multiplexing seems more viable, since dedicated pins drive the anode rows, and the individual color cathodes can be tied together in a column. And I can use BCM to control the brightness of each LED easily without keeping the CPU too busy.

My thoughts are: Can I use the GPIOs to directly drive the anodes and cathodes of the LEDs? I.e. For each row in the matrix, drive the GPIO pin for the anodes in that row high and drive the cathode GPIO pins for the columns low.

I know that the max total GPIO current in high drive mode is 15 mA. Given the above setup with a 10x12 LED matrix, a maximum of 12 LEDs are on at any given time. That's 1.25 mA per LED, which should illuminate the LED. But given that I'd be sourcing and sinking the current, how would that equate with the total GPIO current?

An alternative is to source the current through transistors. But even while mosfets come in small packages, the available board space is so limited. Are there any extremely small multi-mosfet ICs available?

Another alternative is to use shift registers to sink/source the current, and have the GPIOs handle the other (source/sink). That would also free up some GPIOs. I've not worked particularly much with shift registers. Do they come in small packages? And is the operating current fit for a low-power application?

Then there is, of course, the solution to source current through transistors and sink through shift registers. But I have a feeling the bulk of the shift registers and transistors blows that straight out of the water.

Edit: After looking around I've come across SN74HC595 by TI. These shift registers come in 2.5x2.5mm QFN packages. It seems I should be able to drive the anode rows through a couple of these shift registers, and sink the current through the nRF52 GPIOs (I think I read somewhere that it's better to sink through the GPIOs than source).

Related