Page 1 of 1

SDFileSystemVersion 3.1.1 in SW mode

Posted: Fri Mar 07, 2008 5:03 am
by dman776
I am testing in SW mode and is complaining about this Sub...

Code: Select all

Sub ReInitSPIPort()
   SSPControl1 = SPISpeed Or %00100000   // Setup MSSP module & turn on
   SSPStatus = %01000000                         
End Sub
SSPControl1 and SSPStatus are only defined if using MSSP.

It looks like you need the following....

Code: Select all

Sub ReInitSPIPort()
#if SD_SPI in (MSSP)
   SSPControl1 = SPISpeed Or %00100000   // Setup MSSP module & turn on
   SSPStatus = %01000000
#endif
End Sub

Posted: Fri Mar 07, 2008 5:08 am
by dman776
It also seems to not like a 40Mhz HSPLL clock.
It init's and starts a few reads but then errors out. If I clock it down to 10Mhz, all is well.

Posted: Fri Mar 07, 2008 7:21 am
by Steven
Thanks very much for that - the suggested fix is perfect. I've added it to my module and will republish it soon anyway, hopefully with multiple file support.

As for the 40MHz clock, I've tested extensively with 40MHz PLL in MSSP mode and all is OK, but it may be down to the card or the length of your connections to the card socket? If max speed isn't an issue, then 10MHz is probably safer anyway.

Steve