Display SPI Connections on Lolin Pico 3

Hello,
I have a Waveshare 7.5" e-Ink Display v3 (840x400) and would like to run it on a Lolin c3 Pico.
I already managed to run the Display on a common wroom32 but this Lolin Pico has a bit more challenging PIN Layout.

Schematics:

Datasheet for c3:

now I have this in the code:

// Pins for Waveshare e-paper Driver Board
const uint8_t PIN_EPD_BUSY = 2;
const uint8_t PIN_EPD_CS   = 5;
const uint8_t PIN_EPD_RST  = 10;
const uint8_t PIN_EPD_DC   = 8; //
const uint8_t PIN_EPD_SCK  = 1;
const uint8_t PIN_EPD_MOSI = 4;

But I hit a dead end with the combinations I tried so far, sometimes ending in "Busy Timeout!" or something along

ESP-ROM:esp32c3-api1-20210207
Build:Feb  7 2021
rst:0x3 (RTC_SW_SYS_RST),boot:0xd (SPI_FAST_FLASH_BOOT)
Saved PC:0x403819b6
SPIWP:0xee
mode:DIO, clock div:1
load:0x3fcd5810,len:0x438
load:0x403cc710,len:0x918
load:0x403ce710,len:0x24e4
entry 0x403cc710

I have seen in the Datasheet that

For ESP32-C3FH4AZ, pins within the frame (namely pin 19 ∼ pin 24) are not bonded, and are labelled as ”not connected”.

Does this mean I don't have CS0 and also no CLK ?

Maybe you can give me a learning moment when reading all these documents, thank you very much!

Here is the Lolin C3 Pico Documentation, I cannot post more than 3 links as new user:
https://www.wemos.cc/en/latest/c3/c3_pico.html#documentation

Oh and the Code Project I'm cloning is here:

Sorry but I do not want to wander the WWW to be able to guess what you have. Posting an annotated schematic as you have wired it will help a lot. Be sure to show all connections and power supplies.

Oh sorry I did not mean to miss stuff in my original post.

I use these connections:

EPD_BUSY     => Pin 2
EPD_CS       => Pin 5
EPD_RST      => Pin 10
EPD_DC       => Pin 8
EPD_SCK      => Pin 1
EPD_MOSI     => Pin 4

If you look at it from the board perspective this is how I wired it up:

in terms of GxEPD2 looks like this:
BUSY -> 2, RST -> 10, DC -> 8, CS -> 5, CLK -> SCK(1), DIN -> MOSI(4), GND -> GND, 3.3V -> 3.3V

GxEPD2 uses HW SPI. On ESP32C2, ESP32C3, ESP32S2, ESP32S3 the pins used depend on the board you select to compile for. So please report this also.

e.g.: esp32c3/pins_arduino.h:

static const uint8_t SS    = 7;
static const uint8_t MOSI  = 6;
static const uint8_t MISO  = 5;
static const uint8_t SCK   = 4;

e.g. lolin_c3_mini/pins_arduino.h:

static const uint8_t SS    = 5;
static const uint8_t MOSI  = 4;
static const uint8_t MISO  = 3;
static const uint8_t SCK   = 2;

You could re-map the pins if needed.

Jean-Marc

Thank you @ZinggJM for responding so quick!

In Vscode I compile for lolin_c3_mini
In Arduino IDE I try a simple hello world sketch also with Lolin C3 Mini as for both there is no specific Pico 3 available.

I see that lolin_c3_mini pins map SCK to 2, but the Wemos Documentation shows SCK on 1 for the Pico so I guess I need to rewrite that? Thats where my confusion starts :smiley:

Or do i just wire up the driver hat's CLK to Pin 2?

Grüße aus Tirol!

That's up to you. Both options are equivalent (SPIClass maps HW SPI pins according to pins_arduino.h). You can pre-map by calling SPI.begin(...) before display.init(...) in GxEPD2, then the GxEPD2 call of SPI.begin() has no effect.

I think the documentation uses the pins like for ESP8266 Wemos D1 mini shields, but someone got the pins_arduino.h wrong. Not verified yet.

Servus von Luzern und Umgebung.

1 Like

can confirm that indeed Pin 2 is the SCK I can use in GxEPD2. Which is what threw me off!

works beautiful, thank you very much for your help and the awesome work in GxEPD!

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.