I'm trying to talk to a VS1053 chip (http://www.sparkfun.com/products/9943) and I'm having problems changing the speed of the SPI port after I issue a couple commands to change the clock multiplier. Here is an example of what I'm doing...
myspi.begin(SPI_281_250KHZ, MSBFIRST, SPI_MODE_0);
// setup the clock multiplier to allow faster communications
myspi.transfer(...);
myspi.begin(SPI_2_25MHZ, MSBFIRST, SPI_MODE_0);
myspi.transfer(...); // <-- this line fails to bring back meaningful data
I was thinking that I just wasn't configuring the clock multiplier correctly but then I tried calling begin with the same slower clock (SPI_281_250KHZ) and it still fails. If I comment out the second begin it works fine. I also tried calling "end" before the second "begin" and that didn't work either.
So I left the line commented out (in a working state). I then started to work on my SDCard code which uses a different SPI port and ran across the same problem. I start the SPI bus at one speed, do some initialization and then try to increase the speed. Same behavior as before. If I comment out the second "begin" it works.
The problem I'm having now is that I really need to increase the speed of the SPI because it's not keeping up with the MP3s I'm trying to send it.
What is "begin" doing to the SPI bus? Is there something special I need to do when changing the SPI clock speed?