VS1003 question ?

Go To Last Post
6 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Guys,

I managed to play hello.mp3 from SDcard already,
but it's not saying hello....but hellp ?

is it about bit rate or my code isn't right yet ?

Please have a look on the function I have created,

thanks

void PlayMP3(){
       uint16_t j;
FRESULT fr;            /* FatFs return code */
char vs_init,line[512]; /* Line buffer */
UINT num_read,k,count;
uint8_t a_byte;
			int i,p;
			BYTE temp_buffer[100];
			
		VS1003B_Init();
usart_pstr("\n \nEND Reading hello.mp3 file \n");
		
			   			    /*TESTING READING FILE END*/
			    
			
		        
		
/* - This is a special VLSI Solution test header - */
/* - that starts a sine sound. It's good for     - */
  /* - testing your code and the chip. */
	    
		VS1003B_Delay();
	    
	    VS1003B_XDCS_H();
    _delay_ms(500);           /* 500 ms delay */

	    /* Stop the sine test sound */
		 VS1003B_XDCS_L();
	    
		
		VS1003B_Delay();

        VS1003B_XDCS_H(); 
    _delay_ms(500);            /* 500 ms delay */
		
usart_pstr("Sine wave test 's stoped, change to SPI High! \n");
		
	VS1003B_XDCS_L(); // Pull XDCS low
		
		 
 if (bit_is_set(VS1003B_PIN,VS1003B_DREQ))
		 {
		 usart_pstr("\n DREQ = 1 \n \n");
		 }else
		 {
		 usart_pstr("\n DREQ = 0 \n \n");
		 }
        
		for (i=0; i<2048; i++)
		{
			while (bit_is_clear(VS1003B_PIN,VS1003B_DREQ)); // wait here until DREQ is high again
			
			VS1003B_WriteByte(0);
		}
		VS1003B_Delay(0xffff); // Wait until SPI transfer is completed
		_delay_ms(500);
		usart_pstr("VS1003 AND ATMEGA128 SAYING HELLO! \n \n" );
		
		
    }
Last Edited: Tue. Mar 4, 2014 - 12:38 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

File size I want to read = 1,695 bytes

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

That code is unreadable - fix the indent and someone might be able to read it.

Anyway why not actually try debugging for even just 3 seconds instead of always resorting to a forum post first? When you do give in then try google and find one of the tens of MCU + VLSI projects on the internet to compare against.

Oh and stop cross posting.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I can play it now, but sometimes it's playing correctly, sometimes it's playing but very slow...

Is it because of SPI speed ? thanks

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:

I can play it now,

You see, this is exactly why people here are getting more than a little irritated by your threads :evil:

Suppose I just spent 10 minutes studying your code and trying to diagnose faults in it exactly how pissed off do you think I'd be if you then almost immediately came back and said "fixed, it works". That would be 10 minutes of my life you just stole from me. :evil:

I'm just glad I didn't waste my time on this occasion. I hope others take this warning that you appear to be a troll.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

sorry clawson, you don't have to be angry,
I'll try google and myself for few hours before I ask...

thanks