Thanks for the answer. It makes sense (afterwards!).
If the multiplexing can be fast enough without SPI, I would prefer not to use SPI. So I'm posting here my code and you can tell me if something makes it slow.
I represent a "picture" on my 8x8 matrix by a uint64_t. When a bit is high in int, so should be the corresponding LED.
First we loop on each bit:
void pic_display(pic_t pic)
{
int line;
int column;
for(int i = 0; i < 64; i++) {
line = i / 8;
column = i % 8;
if(pic & (0x8000000000000000 >> i)) {
matrix_display_dot(line, column);
}
}
}
And then we call matrix_display_dot:
void matrix_display_dot(char line, char column)
{
// set RCLK low; wait till we transmit the byte, and they moving it high will output the data
digitalWrite(RCLKPin, LOW);
digitalWrite(RCKPin_tpic6b595, LOW);
// shift out the bits (MSBFIRST = most significant bit first)
shiftOut(SERPin, SRCLKPin, MSBFIRST, 1 << line);
shiftOut(SERPin_tpic6b595, SRCKPin_tpic6b595, MSBFIRST, 1 << column);
// send shift register data to the storage register
digitalWrite(RCLKPin, HIGH);
digitalWrite(RCKPin_tpic6b595, HIGH);
}
Can this be made fast enough to have persistence of vision? For now it's just flickering.
P.S: I know I can mix C++ but I'm using a makefile without the Arduino IDE and would prefer to have it in plain C since I don't thing C++ is relevant for such small projects, I don't like C++ that much and I'm considering to learn the AVR behind Arduino in the long term.