Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

5x5x5 LED Cube Troubleshooting

Status
Not open for further replies.

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
 
Thank you for your advice, it definitely helped. I also altered my code so that instead of merely turning the pins that are supposed to be off 'off', I now designate them as input pins so that they are high impedance. Additionally, it seems that a few of the LEDs had burned out during testing (probably due to reverse voltages) and were creating shorts at certain points on the cube. It seems to be working now!
 
It's basically all working, but when I have more than about 2 layers lit up at the same time it's a bit dimmer than I would desire because each layer is really only on for 1/n of the time and I measured Vrms for each LED to be about 1.2V. Common sense tells me that there is no way around this... Any ideas?
 
So now I'm having a problem with the PIC flash memory capacity... The PIC goes crazy and does nothing when I get above ~2000 lines of code when the maximum should be 8192. This is confirmed by the MPLAB Memory Usage Gauge. Any ideas?
 
I do not work with PIC ASM as I use C. But I would think it is a bank switching issue.

Given that you are talking RMS values and programming in ASM I expect that you are pumping as much power to the LEDs as they will take and not overheat. My only suggestion is to use brighter LEDs.
 
So now I'm having a problem with the PIC flash memory capacity... The PIC goes crazy and does nothing when I get above ~2000 lines of code when the maximum should be 8192. This is confirmed by the MPLAB Memory Usage Gauge. Any ideas?

I faced same problems, but I was using C, the problem was the no. of variables used, so I reduced global variables, and it started working.
According to some internet source(I dont remember exactly), the number of global+local registers should not exceed the size of one reg bank (not sure, read long back, rectify if I am wrong).
 
Last edited:
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top