Common Anode (seven segment) display problem
I am trying to figure out how 7led segment displays work, I got a few common cathodes and a few common anodes to test. Did the testing with the common cathodes, they seem to work properly. Now I wanted to try the common anodes, they worked, I changed something to my program and connection to make a dual display, and it doesn't seem to work anymore.
I checked my program hundreds of times, same for the connections, and I really can't figure out what's wrong.
The problem is that there are always 4 led's lit (d,e,f and g).
I tried to change the program to a very basic few lines, to check whether the display was working or not, but still the same results. I'll post these very few lines of code, as well as a very professional drawing of a part of the connection:
code contents (i left the heading and most of the comments to save space and useless reading):
RC6 - Segment a
RC5 - Segment b
RC4 - Segment c
RC3 - Segment d
RC2 - Segment e
RC1 - Segment f
RC0 - Segment g
V1 - RA1
V2 - RA5
PORTA = 0; // reset the bits of port A
PORTC = 0;
TRISA = 0; // All of port A are outputs
PORTA = 0x2; // to check if the first display is working as it should
TRISC = 0x7F; //all of port C are inputs, meaning the anode display shouldn't be lit
Result: led's d,e,f and g are lit, together with the 4 LED's from the PICKit2 (because of the same connection internally, RC0 -> RC3)
I've been watching at it for a while now, but can't seem to fix it at the moment. Any ideas on what I'm doing wrong?