I have been testing SPI with the FEZ Raptor, but cannot achieve slow (<500kHz) clock rates. Here is my code, with the timings I see on my logic analyzer and/or scope.
Private Function BuildConfiguration(chipselectbarpin As Pin, spiModule As SPI.SPI_module) As SPI.Configuration
Dim _csht As UInteger = 1 ' _chipselect holdtime mS (time that CD must remain active before unselecting, or time after the read write completion)
Dim _csas As Boolean = False ' Chip select active state
Dim _csst As UInteger = 0 ' Chip select Setup Time mS (time acter cs before reading)
Dim _ce As Boolean = True ' If true, data is sampled on the rising edge, else falling edge
Dim _cis As Boolean = True ' click idle state, high if true
Dim _cr As UInteger = 5000 ' supposedly clock frequency in kHz
' _cr = 1 gives 615KHz
' _cr = 2 gives 1.26MHz
' _cr = 4 gives 2.5MHz
' _cr = 10 gives 6.35MHz
' _cr = 20 gives 13.3MHz
' _cr = 100 gives 2.51MHz
' _cr = 500 gives 13.3MHz
' _cr = 1000 gives 1.003MHz
' _cr = 2000 gives 2.03MHz
' _cr = 5000 gives 5.13MHz
Dim _spi_mod As Microsoft.SPOT.Hardware.SPI.SPI_module
_spi_mod = spiModule
Return New SPI.Configuration(chipselectbarpin, _csas, _csst, _csht, _cis, _ce, _cr, _spi_mod)
End Function