Main Site Documentation

Unexpected exception at low SPI clock rate


#1

Hi,

I have ported some code from 3.x to 4.1 and suddenly my SPI code now doesnt work.
The problem is that the WriteRead() terminates with an Exception

Exception System.InvalidOperationException - CLR_E_INVALID_OPERATION (15)

Message:

Microsoft.SPOT.Hardware.SPI::InternalWriteRead [IP: 0000]

Microsoft.SPOT.Hardware.SPI::WriteRead [IP: 0027]

I have found out that this problem occurs because I have a low clock speed (50 Khz) and if I increase it to 200 the exception goes away.

I have earlier had the same problem, then you guys said that the lowest clock speed is 36 Khz - so I am a bit confused why this now fails.

This is a cached value of my previous request: http://webcache.googleusercontent.com/search?q=cache:046HyRAtfscJ:www.ghielectronics.com/forum/index.php%3Ftopic%3D1863.0%3Bwap2+%2Bspi+%2Bghi+%2Bronny&cd=1&hl=no&ct=clnk&gl=no&source=www.google.no

I am currently using the SDK 1.0.13 (EMX 4.1.5) on an Embedded Master DevKit.

I urgently need a fix or workaround since this is a critical part of my solution.

Please advice!

Regards,
Ronny


#2

Next SDK is coming out in few days and it will include the low SPI clock rate.