I have one of these generic Aliexpress 2.42in OLED displays that support both SPI and I2C.
I have a smaller 0.96in I2C oled which I have been able to get running no problems but it is a touch small and I will have a few input shift registers on the I2C and SPI should be faster so wanted to run the bigger display in the default mode of SPI.
I am having difficulty finding the correct wiring schematic for the SPI connection to the Micro, I have read a ton but can't map the pins from the Micro to the display. The display has CS, DC, and RES which should be all I need to connect.
All my reading on SPI on a Micro talks about MISO and MOSI but these don't relate to the pins that I have on the board. Also unsure if I have to use the ICSP header or if the SPI pins are also mapped to the main pins as well.
I am looking at the U8X8 library for simple text display and it references the pin numbers on the Micro for the 3 data connections ie :-
The OLED board has 7 pins for the SPI connection however I believe that I only need 5, power, ground and CS, DC and RST. Extensive reading seems to show that the other 2 pins are for when you switch it to I2C mode.
Thanks for the reply, happy re the pins on the micro. The pins on the OLED are CS, DC,RES,SDA,SCLK,VDD and VSS. Any thoughts on how these should map to the Micro?
I believe you will need the full 7.
SDA carries the commands / data to display.
SCLK tells the display when the next bit of data is available on SDA .
CS tells the display when to ignore the Arduino and when to listen.
DC tells the display whether the SDA data is a command or image data.
RST resets the display.
(All hugely oversimplified, but gives a general idea hopefully)
It's not asking about the other pins because, with Arduino Micro, I don't believe (?) that you have the freedom to move the SPI pins around; the library already knows exactly where you're going to be connecting SDA and SCLK.