Electronic – arduino 3×3 LED matrix


i am trying to get a 3×3 matrix with multiplexing up and running. here is my setup:

alt text

i have connected each rows cathodes and each columns anodes and connected that one to pins 0,1,2 resp. 8,9,10

the only thing i can get to light is the lowest row, but if i want to light the middle row for example with this:

digitalWrite(8, HIGH);     
digitalWrite(9, HIGH);     
digitalWrite(10, HIGH);     

digitalWrite(0, HIGH);
digitalWrite(1, LOW);
digitalWrite(2, HIGH);

nothing happens.

is my wiring setup wrong maybe?

Best Answer

Here's a sketch of what you've described for clarity and benefit to others:

Good things to do at this point:

  • Make sure you have current limiting resistors in series with each LED. 560Ω will limit to ~6mA. If these are not presently in place, some LEDs may be burned out, so check them. The ATmega128/328 (whichever is on your board) is limited to *20mA per pin**.
  • Verify that the pins are actually going high or low when you program them to do so, with a voltmeter or logic probe.

*I must correct myself, here. This is the actual restriction:

27.1 Absolute Maximum Ratings
NOTICE: Stresses beyond those listed under “Absolute Maximum Ratings” may cause permanent damage to the device. This is a stress rating only and functional operation of the device at these or other conditions beyond those indicated in the operational sections of this specification is not implied. Exposure to absolute maximum rating conditions for extended periods may affect device reliability. ...

DC Current per I/O Pin             40.0 mA  
DC Current V and GND Pins       200.0 - 400.0 mA 

Although each I/O port can sink more than the test conditions (20 mA at VCC = 5V, 10 mA at VCC = 3V) under steady state conditions (non-transient), the following must be observed: TQFP and QFN/MLF Package: 1] The sum of all IOL, for all ports, should not exceed 400 mA. 2] The sum of all IOL, for ports A0 - A7, G2, C3 - C7 should not exceed 100 mA. 3] The sum of all IOL, for ports C0 - C2, G0 - G1, D0 - D7, XTAL2 should not exceed 100 mA. 4] The sum of all IOL, for ports B0 - B7, G3 - G4, E0 - E7 should not exceed 100 mA. 5] The sum of all IOL, for ports F0 - F7, should not exceed 100 mA. If IOL exceeds the test condition, VOL may exceed the related specification. Pins are not guaranteed to sink current greater than the listed test condition.