Hi, so I’ve got this combination working as software SPI like this
#define SPI_CLOCK 14
#define SPI_DATA 12
#define SPI_CS 15
#define SPI_DC 27
U8G2_SSD1322_NHD_256X64_F_4W_SW_SPI u8g2(U8G2_R0, SPI_CLOCK, SPI_DATA, SPI_CS, SPI_DC);
However ideally I want to run this as Hardware SPI, I’ve tried the following
#define SPI_CS 5
#define SPI_DATA 23
U8G2_SSD1322_NHD_256X64_F_4W_HW_SPI u8g2(U8G2_R0, SPI_CS, SPI_DATA);
The pin numbers are from running Serial.println(MOSI) etc and are as follows:
MOSI 23
MISI 19
SCLK 18
CS 5
these refer to the VSPI pins, I’ve connected the display as follows
Display—————-ESP32
pin 16 CS————–pin05 CS
pin 14 DC————-pin19 MISI
pin 05 Data in——-pin23 MOSI
pin 04 CLK————pin 18 SCLK
The two pins I’m not completely sure of are 14/19 and 05/23 but I’ve tried it both way rounds.
any help much appreciated
I would be astounded if hooking up the ESP32's MISO (not MISI) pin. which the hardware SPI will configure as an input to the ESP32, will work at all with the SSD1322's DC pin, which is an input to the SSD1322 and is expecting to be driven by an output on the ESP32.
My suggestion would be to choose another, non SPI pin to connect to DC and pass that in your constructor.
Just tried pin27, still no joy.
SPI_DATA is ambiguous, SPI_MISI doesn't exist, SPI_MISO is not the right one.
I use SPI_DC
Do you have jumpers on your display that you have to configure?
#include "U8g2lib.h"
#define SPI_CS 5
#define SPI_DC 17
U8G2_SSD1322_NHD_256X64_F_4W_HW_SPI u8g2(U8G2_R0, SPI_CS, SPI_DC);
void setup() {
// put your setup code here, to run once:
u8g2.begin();
}
void loop() {
// put your main code here, to run repeatedly:
}
should work as long as you connect
- SCLK to GPIO 18 (VSPI SCK)
- SDIN to GPIO 23 (VSPI MOSI)
- CS to GPIO 5 (any GPIO should do)
- DC to GPIO 17 (any GPIO should do)
- RST is recommended
- MISO is optional
Hmm, yeah looks like I got things completely wrong, this works
#define SPI_CS 5
#define SPI_DATA 27
ESP——————Display
VSPID 23——5 SDIN
VSPICLK 18——4 CLK
VSPISCO 05—-–16 CS
SPI_DATA 27—--14 DC