adafruit / Adafruit_EPD

e-paper display driver for Arduino
141 stars 57 forks source link

IL91874 not working on ESP32 #7

Closed caternuson closed 5 years ago

caternuson commented 5 years ago

https://forums.adafruit.com/viewtopic.php?f=47&t=149687

I have recreated this using a Feather ESP32 and graphicstest.ino. Tried SW SPI also. epd

PINS

#define SID        18
#define SCLK       5
#define MISO       19
#define EPD_CS     14
#define EPD_DC     32
#define SRAM_CS    15
#define EPD_RESET  33 // can set to -1 and share with microcontroller Reset!
#define EPD_BUSY   27 // can set to -1 to not use a pin (will wait a fixed delay)

C-TOR (SW SPI)

Adafruit_IL91874 display(264, 176, SID, SCLK, EPD_DC, EPD_RESET, EPD_CS, SRAM_CS, MISO);
caternuson commented 5 years ago

Dumping this here also. This is from testing HW SPI, which freezes in ::begin()

Looks like it has to do with SPI.beginTransactionbeing being called twice, this line in csLow(): https://github.com/adafruit/Adafruit_EPD/blob/2.0.2/Adafruit_EPD.cpp#L635 first called here: https://github.com/adafruit/Adafruit_EPD/blob/2.0.2/Adafruit_EPD.cpp#L503 and then the next line calls SPItransfer which calls it again here: https://github.com/adafruit/Adafruit_EPD/blob/2.0.2/Adafruit_EPD.cpp#L584 and it hangs on that second call to SPI.beginTransaction in csLow()

ladyada commented 5 years ago

oof ok. fixing it 'properly' will be a bit annoying - can you do a quick-fix by adding a static bool isInTransaction and test it so we don't transact twice?