Re: Problems with MCP2515 breakout board (8MHZ clock)
Posted: Mon Aug 29, 2016 9:51 am
martinayotte wrote:You should use the HSPI on GPIO12-GPIO15.
(The SPI is dedicated to the Flash)
Thanks for the confirmation.
-->
Open Community Forum for ESP8266, Come share Arduino and IoT (Internet of Things)
https://www.esp8266.com/
martinayotte wrote:You should use the HSPI on GPIO12-GPIO15.
(The SPI is dedicated to the Flash)
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