Your new topic does not fit any of the above??? Check first. Then post here. Thanks.

Moderator: igrr

User avatar
By picstart
#54066 The arduino esp8266 IDE will use the HSPI pins hardware. HSPI uses fixed pins GPIO 12 13 14.
In setup you need something like this
SPI.begin();
//SPISettings mySettting(speedMaximum, dataOrder, dataMode)
SPI.beginTransaction(SPISettings(10000000, MSBFIRST, SPI_MODE0));
Since SPI has 4 modes you need to know from the specs the mode for the MCP chip and the endiness for the data plus the max transfer speed
Now the spi transfers need to be preceded by digitalWrite(CSpin, LOW); and followed by digitalWrite(CSpin, HIGH);
if you use a CS pin other than GPIO15
User avatar
By phenoboy
#54112
picstart wrote:The arduino esp8266 IDE will use the HSPI pins hardware. HSPI uses fixed pins GPIO 12 13 14.
In setup you need something like this
SPI.begin();
//SPISettings mySettting(speedMaximum, dataOrder, dataMode)
SPI.beginTransaction(SPISettings(10000000, MSBFIRST, SPI_MODE0));
Since SPI has 4 modes you need to know from the specs the mode for the MCP chip and the endiness for the data plus the max transfer speed
Now the spi transfers need to be preceded by digitalWrite(CSpin, LOW); and followed by digitalWrite(CSpin, HIGH);
if you use a CS pin other than GPIO15


Thanks, got it! The MCP_CAN library takes care of asserting CS lines and seems to be quite straightforward to use.

I still don't understand why the board manufacturer put CLK, etc. labels for SPI and not HSPI pins. Got me really confused..