Teh0therside
New Member
So I built a 5x5x5 multiplexed LED cube along the same lines as all the other LED cubes out there (common cathode planes, common anode columns) and I'm having a few problems. I'm using a PIC16F887 with 220 ohm resistors on the 25 anode outputs and 2n2222 transistors with 500 ohm base resistors on the cathode planes. When I light up just one layer at a time it works perfectly, but when I try to light up more than one layer by using persistence of vision (only one plane actually on at a time), I get ghosting or something like it. For instance, if I want to light up the top led on a column, one or two of the LEDs below it in the same column also light up very dimly. The columns that are on are at +5v like they should be and the planes that should be grounded are around 0v as they should be, but the planes that are not supposed to be on are floating somewhere between 1v and 2v. I breadboarded a similar circuit and saw that the transistor collector is between 1v and 2v even when the base and emitter are grounded, so I guess that's as it should be even though it wasn't what I expected. I'm quite sure that there aren't any shorts anywhere so I'm not quite sure what the problem is... An example of the code I'm using:
MOVLW b'00001100'
MOVWF PORTA
MOVLW b'11000100'
MOVWF PORTB
MOVLW b'00000001'
MOVWF PORTC
MOVLW b'10010000'
MOVWF PORTD
MOVLW b'00000110'
MOVWF PORTE
MOVLW b'00001100'
MOVWF PORTA
MOVLW b'11000100'
MOVWF PORTB
MOVLW b'00000000'
MOVWF PORTC
MOVLW b'10010001'
MOVWF PORTD
MOVLW b'00000110'
MOVWF PORTE
where the last bit of each port is a ground pin, so the code pic should loop through those commands continuously and only light up the right LEDs in the right layer, but that's not the case. Any ideas?
Thank you
MOVLW b'00001100'
MOVWF PORTA
MOVLW b'11000100'
MOVWF PORTB
MOVLW b'00000001'
MOVWF PORTC
MOVLW b'10010000'
MOVWF PORTD
MOVLW b'00000110'
MOVWF PORTE
MOVLW b'00001100'
MOVWF PORTA
MOVLW b'11000100'
MOVWF PORTB
MOVLW b'00000000'
MOVWF PORTC
MOVLW b'10010001'
MOVWF PORTD
MOVLW b'00000110'
MOVWF PORTE
where the last bit of each port is a ground pin, so the code pic should loop through those commands continuously and only light up the right LEDs in the right layer, but that's not the case. Any ideas?
Thank you