Guys,
Is the right SCK clock on my SPI bus ?
I tried to see in Logic analyzer, some of them can't be read properly....
Am I sending the right SCK clock or wrong one ? Why isn't SCK constantly sent per byte ?? I can see only 4 edges per byte ?
How to fix it ?
Please have a look on the picture :
The code :
void VS1003B_SPI_Low(void) { SPCR = (1<<SPE)|(1<<MSTR)|(1<<SPR1)|(1<<SPR0); SPSR = (0<<SPI2X); } //ÒÔFCK/4ËÙ¶ÈÔËÐÐ //full speed void VS1003B_SPI_High(void) { SPCR = (1<<SPE)|(1<<MSTR)|(0<<SPR1)|(0<<SPR0); SPSR = (1<<SPI2X); //fosc/2 } unsigned char VS1003B_WriteByte(unsigned char CH) { SPDR = CH; while(!(SPSR & _BV(SPIF))); return SPDR; } //´ÓVS1003¶ÁÒ»×Ö½Ú //read one byte from vs1003 unsigned char VS1003B_ReadByte() { SPDR = 0xff; while(!(SPSR & _BV(SPIF))); return SPDR; }
I need something like this :
Any clues ?
Thanks