10 Replies Latest reply on Aug 10, 2015 8:15 AM by Carlos_A

    Low Speed SPI Port Pauses on Minnowboard Max

    joewolski Community Member

      I am using Ubuntu on the Minnowboard Max and trying to use the low speed SPI pins to send data with a SPI clock rate of 15 MHz. After getting the low speed kernel module setup, found here minnow-max-extras/low-speed-spidev.c at master · MinnowBoard/minnow-max-extras · GitHub, a spidev device now shows up in dev and can be used normally. After verifying with a loopback test that the SPI was sending and receiving data correctly, which it was, I attempted to send 1MB of data over SPI in 4KB chunks. However this took approximately 6 times longer than expected, it should have been about 0.5 seconds instead it was 3, and looking at the SPI clock on a oscilloscope yielded the image below.

      TEK0000.BMP

       

      The peaks seen are 8 clock cycles or one byte of data being sent at 15 MHz, however as you can see the SPI bus spends most of its time idling and about only a sixth of its time sending which explains the speed difference, the first delay between bytes is 1.1us and the second larger one is 3.9. Stranger still, when I decrease the clock rate it continues to take 3s to send 1 MB for any clock rate between 15 and 3 MHz, as the clock rate increases the dead time decreases until at 3 MHz the delays are just about gone.

       

      Is this a hardware limit that I am encountering? The fact that it takes 3 seconds for any clock rate between 15 and 3 MHz makes me think that is the case. If anyone knows how to fix this it would be appreciated because my application needs the max transfer rate.