e-Paper icon indicating copy to clipboard operation
e-Paper copied to clipboard

Missing example EPD_7in5bc_V2

Open Ziesie1 opened this issue 2 years ago • 2 comments

Hello, which example in the folder "Arduino/" is the correct version for this e-paper?

As per the documentation it should be the "EPD_7in5bc_V2" example. The name is also listed in the Arduino/README.md file but no corresponding folder could be found.

The example in epd7in5b_V2 didn't work for me. It hangs during initialization in WaitUntilIdle(). I have the 7.5 inch model V3 and the HAT Rev2.2.

Ziesie1 avatar Sep 10 '22 13:09 Ziesie1

epd7in5b_V2 is applicable to your screen. Note that you need to select "4-line SPI".

SSYYL avatar Sep 15 '22 08:09 SSYYL

Thank you for the response. "4-line SPI" is selected and all connections were checked twice.

With a logic analyzer I can confirm the following behavior: After the command POWER ON (04h) the busy pin of the display goes low but never comes high again. This is why the mcu hangs in the WaitUntilIdle() loop. What does this mean?

I am also wondering why in the example epd7inb_V2 the command 71h is being sent during WaitUntilIdle(). This command is not listed in the datasheet?

Ziesie1 avatar Sep 15 '22 14:09 Ziesie1

Hello, I am encountering the same problem as @Ziesie1. I am trying to use the same display with the WaveShare e-Paper ESP32 Driver Board.

matthias-bs avatar Oct 14 '22 15:10 matthias-bs

I found the following hint in the FAQ: Question:Why is the BUSY pin always busy?, but the answer does not really help me to understand the problem.

matthias-bs avatar Oct 14 '22 15:10 matthias-bs

Another weird thing: normally, the ESP32's HSPI interface is wired as follows (see https://github.com/espressif/arduino-esp32/blob/master/libraries/SPI/examples/SPI_Multiple_Buses/SPI_Multiple_Buses.ino):

SCLK - GPIO14
MOSI - GPIO13

but on the WaveShare e-Paper ESP32 Driver Board - according to the Wiki pin list and the schematic - we have:

SCLK - GPIO13
MOSI - GPIO14 (SDI)

matthias-bs avatar Oct 14 '22 16:10 matthias-bs

And maybe because of this, SPI transfers are implemented by bit-banging in the ESP32 Driver Board examples (see DEV_Config.cpp).

matthias-bs avatar Oct 14 '22 16:10 matthias-bs

My display is probably broken. I also tried the raspberry-pi implementation (link), but here I had the same problem with the busy pin.

Ziesie1 avatar Oct 15 '22 13:10 Ziesie1

I tried the MicroPython version from https://github.com/tanahy/micropython-waveshare-epaper today - https://github.com/tanahy/micropython-waveshare-epaper/blob/dev/epaper7in5_V2.py to be precise. I tweaked the pin configuration a little bit to adapt to the WaveShare e-Paper ESP32 Driver Board and got the following results: Ch 0 - brown: SCLK Ch 1 - red: nCS Ch 2 - orange: SDI Ch 3 - green: nBusy Ch 4 - yellow: DC (i.e. Data/nCommand) Ch 5 - blue: nReset "3SPI 0" is the decoded 3-wire SPI bus.

Reset pulse: LabNation_Screenshot44

Then we have got the begin of the init sequence:

  1. Command POWER_SETTING (0x01)
  2. Data 0x07
  3. Data 0x07 LabNation_Screenshot40

... 4. Data 0x3F 5. Data 0x3F 6. Command POWER_ON (0x04) After the POWER_ON command, nBusy turns low and remains low. LabNation_Screenshot41

Repeat: 7. Command GET_STATUS (0x71) 8. Poll nBusy LabNation_Screenshot43

Any ideas?

matthias-bs avatar Oct 15 '22 15:10 matthias-bs

test.py:

"""
	Example for 7.5 inch black & white Waveshare E-ink screen, V2
	Run on ESP32
"""

import epaper7in5_V2
from machine import Pin, SPI, SoftSPI

sck = Pin(13)
miso = Pin(12)
mosi = Pin(14)
dc = Pin(27, Pin.OUT)
cs = Pin(15, Pin.OUT)
rst = Pin(26)
busy = Pin(25, Pin.IN)
spi = SoftSPI(baudrate=20000000, polarity=0, phase=0, sck=sck, miso=miso, mosi=mosi)

e = epaper7in5_V2.EPD(spi, cs, dc, rst, busy)
e.init()

w = 800
h = 480
x = 0
y = 0

# --------------------
[...]

matthias-bs avatar Oct 15 '22 16:10 matthias-bs

I also tried to changed the baudrate to a lower value, switched the display type (A/B) and used an external 3.3V power supply - to no avail.

matthias-bs avatar Oct 15 '22 16:10 matthias-bs

I just found the following PR: https://github.com/waveshare/e-Paper/pull/193 After changing EPD_7in5b_V2.cpp accordingly - as follows - I got something on the display!

/******************************************************************************
function :	Wait until the busy_pin goes LOW
parameter:
******************************************************************************/
void EPD_7IN5B_V2_WaitUntilIdle(void)
{
    Debug("e-Paper busy\r\n");
    volatile unsigned char busy;
        int iter = 0;
	do	{
                //EPD_7IN5B_V2_SendCommand(0x71);
		busy = DEV_Digital_Read(EPD_BUSY_PIN);
		busy =!(busy & 0x01);
                DEV_Delay_ms(100);
                if (iter++ > 150)
                    break;
	} while(busy);
	DEV_Delay_ms(200);      
        Debug("e-Paper busy release\r\n");
}

So, instead of waiting for the Busy signal to become de-asserted, the wait loop left after a timeout. And the SendCommand(0x71) (GET_STATUS) does not seem to be necessary.

matthias-bs avatar Oct 16 '22 14:10 matthias-bs

I ordered a second display (this time 7.5 inch T7, i.e. black/white) and a second WaveShare e-Paper ESP32 Driver Board.

Now I found out that

  • My first WaveShare e-Paper ESP32 Driver Board is broken
  • The example code "epd7in5b_V2-demo" from E-Paper_ESP32_Driver_Board_Code.7z works with the 7.5 inch black/white/red display (type DEPG0750RW) as stated above

matthias-bs avatar Oct 18 '22 18:10 matthias-bs

That's how it was for me, too @SSYYL.

The new display is now running fine with the example code.

Ziesie1 avatar Oct 22 '22 18:10 Ziesie1