Without extra hardware, is this the fastest possible VIA SD card read setup?
This reads a byte from a SD card in 46/38 cycles (non-ZP/ZP):
Code: Select all
lda VIA_PORTA
asl
ora VIA_PORTA
asl
ora VIA_PORTA
asl
ora VIA_PORTA
asl
ora VIA_PORTA
asl
ora VIA_PORTA
asl
ora VIA_PORTA
asl
ora VIA_PORTAI have the SD card data MISO data out pin connected to bit 0 of VIA Port A.
There is nothing else hooked up to that port.
That port is setup to clock on read and the clock pin of the SD card is hooked up to CA2 on the VIA.
The other SD card pins are connected to Port B.
Is this the fastest SD card read possible out of a VIA alone?
I think it could be?
Given that;
I'm also interested in the smallest hardware change that would improve the SD read speed?
If the VIA lived in zero page that would reduce the cycles to 38, but what else can be done?
Is there an easy way to use the shift register on the VIA for data in?
I think the clock is 'backwards' from the VIA and needs to be inverted with a NAND or NOT or flipflop, is that correct?
I could use a shift register on the 8 bit port A and shift it in but what is a good way to clock that such that I actually save CPU cycles?
I'm not really caring about robustness, or saving VIA ports for other uses, just read as fast as possible with as small and simple of a hardware change as possible.
Any suggestions out there?
Thanks!