I'm trying to connect 48 individual LEDs to at SAMD51 microcontroller. I evaluated several options, and this seems to the best for my situation:
6x8 matrix, cathodes connected directly to the microcontroller GPIOs, and anodes connected to a 74HC595 shift register.
I know that I should use better ICs like MAX7219 or TPIC6B595N, but I'm going to manufacture/assemble this PCB in china and those ICs are not provided for assembly.
I already tested the LEDs with about 2mA of current, and they look fine with 2mA.
I'm not sure if GPIO pins of the SAMD51 are able to sink that much current (I would need 8x 2mA for each GPIO, assuming all the columns are HIGH, right?), so I'm wondering if I should put NPN on each row (cathodes) of the matrix.
thank you
Using a parallel diode connection with one common resistor is not a good idea due to the variation of the diode forward voltage. As a result, some diodes will shine brightly, while others will dimly or may even go out completely.
I think your evaluation was flawed. It must be because you don't even know what maximum current the SAMD chip's pins can source/sink. You didn't check the data sheet. Presumably you didn't check the data sheet of the 74hc595 either.
What other options did you consider?
With 1K series resistor, only around 1.5mA will flow in theory. Probably less in practice if you ask the SAMD pins to source or sink a large current.
But that 1.5mA will only flow through an led with a duty cycle of 1/6, so the average current will be only 0.25mA. it's the average current that determines the brightness.
If the PCB assembly service you plan to use truly has only SAMD and 74hc595 available (which seems unbelievable), at least check the data sheets for those maximum source & sink currents, both for their individual pins and overall limits for the chips, and then re-evaluate your options including connecting anodes or cathodes to the SAMD pins or the 74hc595 pins, scanning by row and by column, and see if you can get that average LED current up a little.
thanks for the help! I was obviously missing some key points, so I apologise for my ignorance.
I tried to redrawn the schematic so that the LEDs are not stressing the 74HC595 or the SAMD pins. I hope this is a correct approach.
LED current limiting resistor values are yet to be determined. I guess with this approach, for each 74HC595 transfer, I only need to activate a single column at the time.
if the PCB assembly service you plan to use truly has only SAMD and 74hc595 available (which seems unbelievable)
what I said is not quite right. They also have other options, but much more expensive and not always in stock. Using NPNs/PNPs with a basic 74HC595 is much cheaper than any other IC option
I also removed the 74HC595 because I managed to get 8 free pins on the microcontroller. So now it would be PNPs on the rows, and NPNs on the columns. What do you think? thank you