Sunday, October 29, 2017

Fast partial refresh on 4.2" E-paper display from Waveshare / Good Display



Google Drive link with Arduino firmware used in this project: https://drive.google.com/open?id=0B4YXWiqYWB99UmRYQi1qdXJIVFk



I bought the Waveshare devices on Aliexpress: https://www.aliexpress.com/item/400x300-4-2inch-E-Ink-display-module-SPI-Without-backlight-Compatible-with-variuous-board-Ultra-low/32827172081.html


Datasheet with the 42-byte LUT format used in the 4.2" display, but not the exact correct part.
https://www.smart-prototyping.com/image/data/9_Modules/EinkDisplay/GDEW0154T8/IL0373.pdf


Interesting thread with other folks experimenting with LUTs on the 2.7" display.
https://github.com/olikraus/u8g2/issues/318


Waveshare (distributor) datasheet
https://www.waveshare.com/w/upload/6/6a/4.2inch-e-paper-specification.pdf



Good Display (manufacturer) datasheet
http://www.good-display.com/products_detail/productId=321.html

Waveform "theory" with class 7-5-7 pulse sequence:
http://www.multicomponent.se/sub_group_files/13dae3f428be3929dc13fed1f79c5e40.pdf

My favorite microcontroller dev board, the Teensy: https://www.pjrc.com/teensy/

The new awesome 5-series oscilloscope from Tek: https://www.tek.com/oscilloscope/5-series-mso-mixed-signal-oscilloscope


9 comments:

  1. A very cool video and it was really interesting seeing the details you've managed to dig up on how this kit works.

    You mention that the epd code is "Public Domain", but the code from waveshare's wiki has only readmes with licenses and they're "All Rights Reserved", which means that you don't even have rights to download it from their website. I'd say it was a license fail since I doubt very much they intend to distribute undistributable code.

    It would be hard to make a commercial project without being invited into copyright infringement with their products though. Still cool tech though.

    ReplyDelete
    Replies
    1. Thanks! The header of the .cpp files says the code is completely free to use as long as the header is maintained in the copies. I think some folks write licenses without knowing the exact details, but it seems they want to give the code away as long as they are credited as the source.

      Delete
  2. Excellent video with helpful information. Thank you!

    Did you produce your video with the code you provide for download?

    After some syntax fixes I get only white screen and some short flashes.

    ReplyDelete
    Replies
    1. Thanks! Yes, the code is the same as shown in the video. What syntax errors did you encounter? I'm using the Teensy 3.x dev board, which is capable of pretty high speed SPI. I have it set to 18MHz in epdif.cpp Try turning it way down (start at 1 MHz)

      Delete
    2. I have no Teensy, and not installed Arduino package for Teensy 3.x (would need to search for, seems not part of the unofficial list, only 2.x found).

      elapsedMillis may be a type name for Teensy?
      digitalWriteFast seems to be a method for Teensy.

      I reduced SPI speed to 4MHz, which is in the specs range and works fine with my examples.

      I get only white screen, and the typical full refresh black/white flashes.

      Jean-Marc Zingg

      Delete
    3. Yes, elapsedMillis and digitalWriteFast are part of Teensyduino. You can simply change digitalWriteFast to digitalWrite, and remove elapsedMillis. Does the stock Waveshare firmware work with your display? Are you using the black-and-white 4.2"? Do you have enough RAM for a full 400x300 framebuffer? If not, you'll want to construct a smaller framebuffer, and only update a part of the display's RAM at a time (like the original Waveshare firmware).

      Delete
  3. Yes to all your questions.
    Currently I have no time to analyze why it does not work for me.

    Have you repeated your test, e.g. after complete power switch off?
    I had seen some strange effects with partial update, also with the Waveshare code.

    ReplyDelete
  4. Hi Ben,
    great work! It seem sto me that your LUT only are setup for BW and not for BWR (with red color) mode?
    Have you tried it with the BWR mode too?
    Thanks and best regards,
    Erich

    ReplyDelete
  5. Same question here, I'm interested in enhancing my BWR EPD refresh/parital update rate.

    Chaps

    ReplyDelete