Electronic – Learning Multiplexing with LEDs, transistor switching speeds

bjtmultiplexer

I am working with some friends trying to multiplex. The issue we run into is we aren't sure if we are hitting a limit on transistor switching speeds.

I am unsure if this is a hardware or software problem. (please let me know if I am in the wrong place)

Here's an example of what we have built.
Schematic

Where we have an output attached to each transistor. We want to be able to turn them all on or individually. We ran into a software problem and asked on Stackoverflow earlier, here is reference if needed

Here's the problem we run into:
LED Cube

This is where I'm not sure to post in Stackoverflow or here:

We always have a row "ghosted" behind. So from the top (Row 3), we have it on and you can see faintly that row 1 (the bottom) is on. If the Row 2 transistor is activated (and Row 3 deactivated) then we have Row 3 faintly on. (with Row 1 being off entirely)

If we just disconnect the ghosted row from its output, it stays ghosted. Somehow it is being tied to our other output.

The Column transistor is a PNP3906 and the row transistor is a NPN2222. According to their datasheets both seem fast enough (but I don't know how to read the sheet effectively)

I have tried adding a pull down resistor to the base of the row transistors with no avail. I also tried paralleling a capacitor to see if maybe it was a speed issue (link to reference, Russell McMahon's answer)

I would be inclined to say that it is a software bug but since the issue still exists with the output disconnected I am unsure.

One more piece of information. We started out every 20 microseconds to switch rows. (turn row 1 on, wait 20 microseconds, turn row 1 off, turn row 2 on, wait 20 microseconds, etc..)

This makes the "ghosted" LEDs much brighter. The picture in this question which are much dimmer are every 5 milliseconds switch rows. However, going from 5 milliseconds to 1 second delay does not change the "ghosted" row

I realize this might be hard to troubleshoot but thanks if you can help

3906 timing [datasheet]:

  • Delay Time : 35ns
  • Rise Time: 35 ns
  • Storage Time: 225ns
  • Fall Time: 75ns

NPN2222 Timing datasheet

  • Turn on Time: 35ns
  • Turn off Time: 285ns

EDIT:
Sorry, I didn't mention voltage. From an MSP430G2553, the voltage is 3.3V, directly from an output

Best Answer

Explicitly specifying a "dead time" between rows is pointing towards a timing problem. Two possible causes of this :

  1. Some overlap between updating the row and column drivers, e.g. on different ports, written in different cycles. This has a simple software fix : (a) turn off all rows (b) update columns (c) turn on correct row. Alternatively, turn off all columns, update row, turn on appropriate columns.
  2. Switching delay in turning transistors off. Q8,9,10 in the given circuit will saturate, which makes their turn off time slow. My answer to this question describes this phenomenon : the question itself describes a hardware fix to the problem (a schottky diode between base and collector). However a simpler answer is to wait through the "dead time" in software, as suggested in the comment above. Obviously times t1 and t2 can be tuned for best visual experience.