How to feed VS1003 from Sdcard ?

Status
Not open for further replies.

bianchi77

Advanced Member level 4
Joined
Jun 11, 2009
Messages
1,313
Helped
21
Reputation
44
Reaction score
20
Trophy points
1,318
Location
California
Activity points
9,442
Guys,

How can I pass a bytes from SD card to VS1003 ?
any ideas ?

Thanks
Code:
fr = f_open(&Fil, "hello.mp3", FA_READ);
  usart_pstr("Reading hello.mp3 file \n \n");
  /* Read all lines and play it */
  usart_pstr("Reading file \n \n");
 for(k=0;k<10;k++)      
   {//begin 10 loop   
      
      VS1003B_SPI_Low();
         
         
         
          /* Read all lines and display it */
          fr= f_read(&Fil, line, 512, &num_read);
         usart_pstr(line);
            sprintf_P( &temp_buffer[0], PSTR("fr==>\n"), fr );
            usart_pstr( &temp_buffer[0] );
            
         
            if(fr==FR_OK)
              {
                 for(count=0;count<16;count++)
                    {
                        loop_until_bit_is_set(VS1003B_PIN,VS1003B_DREQ);
       
                        if (bit_is_set(VS1003B_PIN,VS1003B_DREQ))
                          {
                              usart_pstr("\n DREQ = 1 \n \n");
                              VS1003B_WriteDAT(&line[32*count]);
                          }else
                          {
                           usart_pstr("\n DREQ = 0 \n \n");     
                          }
                  }
             }
       /* pull XDCS low, now SPI writes go to SDI port    */
                  
   }//end 10 loop
 

Status
Not open for further replies.

Similar threads

Cookies are required to use this site. You must accept them to continue using the site. Learn more…