Hello,
I'm selecting the line and column of my 8x8 matrix with SPI. I have a problem, sometimes one or more LEDs are selected when they shouldn't. I checked the decoding code that decodes the 64bits and iterates over each bit, and I'm sure that it is correct (I displayed the value in ascii in the console and it's good).
Moreover I know that it's not a decoding problem because depending on the order on how I call the SPI transfer, the LEDs that are displayed and should not are different.
For instance when writing this code:
void matrix2_display_dot(char line, char column)
{
digitalWrite(RCLKPin, LOW);
SPI.transfer(1<<line);
digitalWrite(RCLKPin, HIGH);
digitalWrite(RCKPin_tpic6b595, LOW);
SPI.transfer(1<<column);
digitalWrite(RCKPin_tpic6b595, HIGH);
}
I get a different result than when writing this code:
void matrix2_display_dot(char line, char column)
{
digitalWrite(RCKPin_tpic6b595, LOW);
SPI.transfer(1<<column);
digitalWrite(RCKPin_tpic6b595, HIGH);
digitalWrite(RCLKPin, LOW);
SPI.transfer(1<<line);
digitalWrite(RCLKPin, HIGH);
}
What's the problem? Is there some current leakage or something?