Page 3 of 6

Re: Drivers for Waveshare 2.13inch E-Ink display

Posted: Sat Feb 17, 2018 10:30 pm
by danielm
@mcauser
Could you please share your driver with us? :)

Re: Drivers for Waveshare 2.13inch E-Ink display

Posted: Fri Feb 23, 2018 3:53 pm
by mcauser
It's still a work in process, but complete enough for you to start experimenting.
Various size panels, Black/White, Black/White/Red and Black/White/Yellow displays.
https://github.com/mcauser/micropython-waveshare-epaper

I only own the 2.9" B/W display and i've got it working with my STM32F407VET6 board, drawing images generated with PIL and using the frame buffer (MONO_HLSB).

Drivers for:
* 1.54inch e-Paper Module
* 1.54inch e-Paper Module (B)
* 1.54inch e-Paper Module (C)
* 2.13inch e-Paper HAT
* 2.13inch e-Paper HAT (B)
* 2.13inch e-Paper HAT (C)
* 2.7inch e-Paper HAT
* 2.7inch e-Paper HAT (B)
* 2.9inch e-Paper Module <-- mine
* 2.9inch e-Paper Module (B)
* 2.9inch e-Paper Module (C)
* 4.2inch e-Paper Module
* 4.2inch e-Paper Module (B)
* 4.2inch e-Paper Module (C)
* 4.3inch e-Paper UART Module
* 7.5inch e-Paper HAT
* 7.5inch e-Paper HAT (B)
* 7.5inch e-Paper HAT (C)

All of the (B) modules are Black/White/Red.
All of the (C) modules are Black/White/Yellow.

Re: Drivers for Waveshare 2.13inch E-Ink display

Posted: Sun Mar 04, 2018 9:43 pm
by devrosx
mcauser wrote:
Fri Feb 23, 2018 3:53 pm
It's still a work in process, but complete enough for you to start experimenting.
Various size panels, Black/White, Black/White/Red and Black/White/Yellow displays.
https://github.com/mcauser/micropython-waveshare-epaper

I only own the 2.9" B/W display and i've got it working with my STM32F407VET6 board, drawing images generated with PIL and using the frame buffer (MONO_HLSB).

Drivers for:
* 1.54inch e-Paper Module
* 1.54inch e-Paper Module (B)
* 1.54inch e-Paper Module (C)
* 2.13inch e-Paper HAT
* 2.13inch e-Paper HAT (B)
* 2.13inch e-Paper HAT (C)
* 2.7inch e-Paper HAT
* 2.7inch e-Paper HAT (B)
* 2.9inch e-Paper Module <-- mine
* 2.9inch e-Paper Module (B)
* 2.9inch e-Paper Module (C)
* 4.2inch e-Paper Module
* 4.2inch e-Paper Module (B)
* 4.2inch e-Paper Module (C)
* 4.3inch e-Paper UART Module
* 7.5inch e-Paper HAT
* 7.5inch e-Paper HAT (B)
* 7.5inch e-Paper HAT (C)

All of the (B) modules are Black/White/Red.
All of the (C) modules are Black/White/Yellow.
thanks :)
i own 4.2inch e-Paper Module (B)
tried your library but dont know about pins connection (DIN and CLK on board) what should be conected on my esp32?
here is my pinougt
Image
thanks...

Re: Drivers for Waveshare 2.13inch E-Ink display

Posted: Sun Mar 04, 2018 10:27 pm
by mcauser
Din and Clk are SPI pins. Data In and Serial Clock.

Din on a module would connect to the MOSI pin on a microcontroller. MOSI = master (data) out, slave in.

GPIO23 = MOSI
GPIO18 = SCK

The CS pin is for telling the SPI module that you are speaking to it and not others on the bus. If there are no other SPI devices on the bus, you could connect this pin to GND to save an IO pin. Haven’t tested this though.

The DC pin is for toggling between they command and data registers.

The RST pin is so you can reset the display.

The BUSY pin is so you can execute slow running commands then can poll the pin until it’s low before continuing.

Re: Drivers for Waveshare 2.13inch E-Ink display

Posted: Mon Mar 05, 2018 8:33 pm
by devrosx
mcauser wrote:
Sun Mar 04, 2018 10:27 pm
Din and Clk are SPI pins. Data In and Serial Clock.

Din on a module would connect to the MOSI pin on a microcontroller. MOSI = master (data) out, slave in.

GPIO23 = MOSI
GPIO18 = SCK

The CS pin is for telling the SPI module that you are speaking to it and not others on the bus. If there are no other SPI devices on the bus, you could connect this pin to GND to save an IO pin. Haven’t tested this though.

The DC pin is for toggling between they command and data registers.

The RST pin is so you can reset the display.

The BUSY pin is so you can execute slow running commands then can poll the pin until it’s low before continuing.
Thanks for explanation,
so conected display, uploaded right library and test.py, but problem is that in loboris micropython build is pyb library missing (propablly should use machine library instead), also it looks that SPI have no SPI.MASTER class...

should i use official build, or try to modify test.py for loboris version?

thanks Devros

Re: Drivers for Waveshare 2.13inch E-Ink display

Posted: Mon Mar 05, 2018 9:46 pm
by mcauser
As long as you pass it a valid SPI object which has a .write() method, it should work.

I haven't used the loboris build, so I'm not sure what the SPI syntax is. Maybe something like this:

Code: Select all

from machine import Pin, SPI
spi = SPI(1, baudrate=2000000, polarity=0, phase=0)
 
from machine import Pin, SPI
spi = SPI(-1, baudrate=2000000, polarity=1, phase=0, sck=Pin(0), mosi=Pin(2), miso=Pin(4))

Re: Drivers for Waveshare 2.13inch E-Ink display

Posted: Tue Mar 06, 2018 9:56 pm
by devrosx
mcauser wrote:
Mon Mar 05, 2018 9:46 pm
As long as you pass it a valid SPI object which has a .write() method, it should work.

I haven't used the loboris build, so I'm not sure what the SPI syntax is. Maybe something like this:

Code: Select all

from machine import Pin, SPI
spi = SPI(1, baudrate=2000000, polarity=0, phase=0)
 
from machine import Pin, SPI
spi = SPI(-1, baudrate=2000000, polarity=1, phase=0, sck=Pin(0), mosi=Pin(2), miso=Pin(4))
thanks again...
fixed code test.py (changed this)

Code: Select all

import epaper4in2b
from machine import Pin, SPI

# SPI3 on Black STM32F407VET6
# spi = SPI(1, baudrate=2000000, polarity=0, phase=0)
spi = SPI(-1, baudrate=2000000, polarity=1, phase=0, sck=Pin(0), mosi=Pin(2), miso=Pin(4))
cs = Pin(6, mode=Pin.OUT)
dc = Pin(7, mode=Pin.OUT)
rst = Pin(8, mode=Pin.OUT)
busy = Pin(9, mode=Pin.OUT)

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

w = 400
h = 300
x = 0
y = 0
but then response is

Code: Select all

. Exception was unhandled.
Guru Meditation Error: Core  0 panic'ed (IllegalInstruction)
and restart micropython.... (tried both SPI command)
propablly something stupid on my side :)

Re: Drivers for Waveshare 2.13inch E-Ink display

Posted: Wed Mar 07, 2018 12:16 am
by loboris
@devrosx

On ESP32 boards GPIO6 - GPIO11 are used to access the SPI Flash from which the program is running and cannot be used for other purposes.

Try to use some other GPIOs.

Re: Drivers for Waveshare 2.13inch E-Ink display

Posted: Wed Mar 07, 2018 8:31 pm
by devrosx
loboris wrote:
Wed Mar 07, 2018 12:16 am
@devrosx

On ESP32 boards GPIO6 - GPIO11 are used to access the SPI Flash from which the program is running and cannot be used for other purposes.

Try to use some other GPIOs.
thanks that was the problem... :)

Code: Select all

spi = SPI(SPI.HSPI, baudrate=2000000, sck=19, mosi=23, miso=25, cs=26)
looks like works
next thing is that i changed low() and high() to value(0) and value(1) to fix script

but now im stuck on epaper4in2b.py has no clear_frame_memory atribute... looks like its not complete

Re: Drivers for Waveshare 2.13inch E-Ink display

Posted: Wed Mar 07, 2018 8:36 pm
by mcauser
Have a look at epaper1in54.py.
Some of the drivers have more methods than others.
I only have a 2.9” b/w to test with.