// startup sequence for sdsc cards: // a-b-c-d-f (loop til 0) - d // write - h // read - i // card data - g // serial test - e // reload write buffer with random data - m // compare read to write buffers - k // read multiple blocks - n // write multiple blocks - p // compare multiple blocks - q #define LEN 64 byte data_buff[512]; byte data_buff2[512]; unsigned long time_buff[LEN]; unsigned int packets[LEN]; byte t = 0; void setup() { Serial.begin(9600); // setup spi PORTB |= 0x2c; // all pins high DDRB = 0x2c; // sck,mosi,ss all output SPCR = 0x53; // master, mode0, ck/64 SPSR = 0; // clear spi2x PORTD |= 1< 0) n = Serial.read(); // fill data buffer for (int i = 0 ; i < 512 ; i++) { data_buff[i] = 0xaa; } } void loop() { while (Serial.available() <= 0); char j = Serial.read(); Serial.println(j); if (j == 'a') { Serial.println("initiate"); for (byte i = 0 ; i < 12; i++) { SPDR = 0xff; while(!(SPSR & (1< 0 ; k--) { SPDR = 0x0ff; while(!(SPSR & (1< 0; i--) { SPDR = 0x0ff; while(!(SPSR & (1<