-
• #2
After a bit more reading I think I now understand - if specified the sck, mosi & miso options MUST always refer to a pin which is marked as being the sck, mosi & miso for that particular SPI.
SPI1 can either use pins B3, B4,B5 or pins A5, A6, A7.
SPI2 & SPI3 only have one set of available pins each.
The purpose of specifying the pins in the tutorial was to ensure A6 was left unused by the SPI1 so that it could be used as a basic GPIO.
I'm getting there gradually I think!!
-
• #3
One more option could be to use soft SPI, so you can use any pin of your choice.
See http://www.espruino.com/Reference#SPI for more information.
I ordered a Nokia 5100 LCD board with my Espruino and like the idea of having it soldered directly to the board as described in the tutorial.
Just one question - in the tutorial you twist the DC & DIN pins (to get the DIN pin over A7 - SPI1 MOSI, leaving A6 available for the DC pin)
Could the SPI MOSI & MISO have been swapped in SPI1.setup so that the pins didnt need twisted?
i.e. SPI1.setup({ baud: 1000000, sck:A5, mosi:A6 }); Leaving A7 for the DC pin.
(Hopefully I'm not posting too many questions - I'm trying my best to figure things out myself before asking!)