-
-
Notifications
You must be signed in to change notification settings - Fork 213
Closed
Description
The RP2040 implementation of SPI has (in the relevant SPI.h):
class MbedSPI : public SPIClass
{
:
private:
SPISettings settings = SPISettings(0, MSBFIRST, SPI_MODE0);
:
where "0" is the bitrate. Presumably, at some point this is converted to the default SPI clock rate for mBed, buried deep inside the mBed code, and it becomes about 1MHz. However, I think it should be just:
SPISettings settings = SPISettings();
or perhaps
SPISettings = DEFAULT_SPI_SETTINGS;
(both of which come from API/HardwareSPI.h, and defined a default bitrate of 4MHz.)
With the current code, the default SPI bitrate for RP2040 based boards is one quarter of the speed that it is on an AVR.
A possible workaround, and to get higher speeds, is for uses to provide their own SPI settings:
SPISettings mySPIsettings = SPISettings(10000000, MSBFIRST, SPI_MODE0); //10MHz
SPI.beginTransaction(mySPIsettings);
Metadata
Metadata
Assignees
Labels
No labels