so i bought the vs1003 breakoutboard from cutedigi.com
http://www.cutedigi.com/product_info.php?products_id=4343&osCsid=f4a3935e2c6ffb73cc702f7bfc2acb1e
i started learning sdi communication and i think i got some of it down, im not sure if im doing all this right on the code so can you guys please let me know where im going wrong or what i need to change?
#include <SPI.h>
#include <SD.h>
File myFile;
const int sdi = 8; //the sdi interface for the vs1003
const int sci = 9; //the sci interface for the vs1003
const int sdss = 10;
const int xreset = 4;
const int dreq = 5;
byte SM_RESET = 0x0004;
byte toSend = 0xF844;
void setup(){
Serial.begin(9600);
Serial.print("Initializing sd card....");
pinMode(sdss, OUTPUT);
if(!SD.begin(10)){
Serial.print("Initialization failed!");
return;
}
Serial.print("Initialization Succesful!\r\n");
}
void loop(){
if(SD.exists("song1.mp3")){
Serial.print("Song1 exists!\r\n");
myFile = SD.open("song1.mp3", FILE_READ);
}
boolean done = false;
while(!done){
setSPI();
digitalWrite(sci,LOW);
if(digitalRead(4))
digitalWrite(4,LOW);
delay(1);
SPI.transfer(0x0);
SPI.transfer(SM_RESET);
delay(7);
if(digitalRead(5)){
done = true;
}
}
SPI.transfer(0x0);
SPI.transfer(toSend);
SPI.transfer(0xB);
SPI.transfer(0x0000);
digitalWrite(sci,HIGH);
digitalWrite(sdi,LOW);
SPI.transfer(0x0);
SPI.transfer(0x0);
SPI.transfer(myFile);
for(int i = 0; i < 1048; i++){
SPI.transfer(0x0);
}
myFile.close();
}
void setSPI(){
SPI.begin();
SPI.setBitOrder(MSBFIRST);
SPI.setDataMode(SPI_MODE0);
SPI.setClockDivider(SPI_CLOCK_DIV8);
}
thanks for the help! =)