Seeed-Studio / ArduinoCore-mbed

3 stars 6 forks source link

mbed: SPI not working correctly #16

Open raffiniert opened 1 year ago

raffiniert commented 1 year ago

Both clock frequencies are 8MHz, but the interval between one data transfer and the next is 20uS for mbed, while non-mbed is 6uS. The throughput is very different. The mbed’s SPI has poor performance.

(quote of msfuijno from https://forum.seeedstudio.com/t/spi-not-working-with-mbed-was-performance-of-xiao-with-sharp-memory-display/268057/7)

SPI is basically unusable on mbed.

On top, a Sharp Memory Display does not work at all using hardware SPI but does work in software SPI (same pins!). Maybe the waveform is not accurate enough (not square enough because they are not high power) in mbed. See the above thread.

msfujino commented 1 year ago

I knew that there were differences between “mbed” and “non-mbed” in terms of maximum SPI clock frequency (mbed:8MHz non-mbed:32MHz) and port drive mode (mbed:standard drive non-mbed:high drive). However, when I used an OLED display at the same 8 MHz, I found that there was a big difference in frame rate. I investigated and found that the main reason is that the 1-byte transfer time is 5.6uS for “non-mbed” and 19.5uS for “mbed”. The data transfer throughput is only 1/3.5. See link below. "https://forum.seeedstudio.com/t/xiao-nrf52840-mbeds-spi-performance-is-only-1-3-5-of-non-mbeds/268145"