I used this sketch to measure practical differences between Arduino and Galileo. It counts loops per second while doing an SPI call (function brings SS pin low and calls SPI.transfer). I was using it with the can-bus shield, which requires a library to be imported. However, you don't need the shield to perform this test. If you want to avoid the library stuff, go ahead and modify it with any function calls you want.
ReceiveMessagesPerSecond.ino.zip 526 bytes
Thanks for your reply. Exactly what I'm looking for. But I don't quite follow
If you want to avoid the library stuff, go ahead and modify it with any function calls you want.
I would prefer not to use the CANbus shield library. What function would you recommend to test the gpio speed?
Sorry, I should have been more clear. You can call any function that is a SPI read/write. I would pick one that simply transfers data, nothing fancy, you would need to peek inside the library to see that.
If you wanted to write your own, it's simple. In every SPI read/write function SPI.transfer or SPI.transferBuffer are called. You'll notice that the chip select is cycled about the transfer, forexample:
That process is needed for any SPI read/write.
It's not entirely clear, but the slow down is either in the cycling of the chip select, or somewhere in the data transfer process (linux driver). It's probably a little of both.