Waveshare 2.13in display v2 driver

Discuss development of drivers for external hardware and components, such as LCD screens, sensors, motor drivers, etc.
Target audience: Users and developers of drivers.
User avatar
T-Wilko
Posts: 21
Joined: Thu Sep 19, 2019 8:08 am

Re: Waveshare 2.13in display v2 driver

Post by T-Wilko » Sat May 23, 2020 3:51 pm

JeroenH wrote:
Sat May 23, 2020 8:40 am

I'm not entirely sure I've set the correct SPI pins, I've cobbled the pin numbers together from several sources, none of which official. The official Lilygo website (which btw is blocked by my employer's proxy!) isn't much help in that regard either.
Have a read of their GitHub repo. That link is for your specific epaper range's repo and it appears most of your SPI pins are set up correctly. I've written and tested a few epaper drivers from the datasheet up, and your picture looks like the ePaper isn't initialised correctly within the driver as that sort of static image has hit me a few times as well. If you're really wanting it to work I'd recommend writing your own driver from the datasheet (which isn't as hard as it sounds, as I found out)
Assuming this can be made to work, mcauser's example scripts only draw images. How would one draw a pixel? If I know how to do that, I should be able to figure out how to draw lines, rectangles, circles, etc.
If you write your own driver, you can make it a framebuffer-derived one like this one that I wrote for another epaper driver IC. This has many advantages, including the fact that you can utilise the FrameBuffer methods directly, and enables you to draw pixels, lines, rectangles, text etc. on to the framebuf buffer that gets sent to your ePaper IC for display, which makes everything a lot easier.

JeroenH
Posts: 2
Joined: Sat May 23, 2020 8:19 am

Re: Waveshare 2.13in display v2 driver

Post by JeroenH » Sat May 23, 2020 7:25 pm

T-Wilko wrote:
Sat May 23, 2020 3:51 pm
Have a read of their GitHub repo. That link is for your specific epaper range's repo and it appears most of your SPI pins are set up correctly.
Many thanks! This at least allows me to confirm that I use the correct pins. That removes one uncertainty from the equation.
I've written and tested a few epaper drivers from the datasheet up, and your picture looks like the ePaper isn't initialised correctly within the driver as that sort of static image has hit me a few times as well. If you're really wanting it to work I'd recommend writing your own driver from the datasheet (which isn't as hard as it sounds, as I found out)
You overestimate my programming abilities greatly ;) I am new to micropython, I've just been learning it for the last two weeks. I used to use Arduino (and this unit works well under Arduino), but I want to switch to micropython. However, that means that writing a driver is beyond me for now.
If you write your own driver, you can make it a framebuffer-derived one like this one that I wrote for another epaper driver IC. This has many advantages, including the fact that you can utilise the FrameBuffer methods directly, and enables you to draw pixels, lines, rectangles, text etc. on to the framebuf buffer that gets sent to your ePaper IC for display, which makes everything a lot easier.
Again, that is beyond my abilities at this point. I will have to keep an eye on this topic to see if a working driver surfaces, or come back to this when my micropython abilities have improved to a point where I feel confident enough to pick something like this up.

In any case, thank you very much for your comment.

Post Reply