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:

I bought the Waveshare devices on Aliexpress:

Datasheet with the 42-byte LUT format used in the 4.2" display, but not the exact correct part.

Interesting thread with other folks experimenting with LUTs on the 2.7" display.

Waveshare (distributor) datasheet

Good Display (manufacturer) datasheet

Waveform "theory" with class 7-5-7 pulse sequence:

My favorite microcontroller dev board, the Teensy:

The new awesome 5-series oscilloscope from Tek:


  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.

    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.

  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.

    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)

    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

    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).

  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.

  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,

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


  6. Yeah, after some fixes it works for me on arduino due
    Thanks :)

  7. Thank you so much! It's hard to find information on these things that isn't in broken English or Chinese!

    It's not just me! I've had to compare like 4+ documents with conflicting hardware layouts and software commands, complemented by bug-filled demo code. I'm a novice at this, and I thought I just didn't know the tech properly; but finding out that you had problems with getting information makes this feel a lot less painful.

    I cannot express how important your post is to me, because trying to get this to work for the last 5+ months at my job has been a nightmare!

    I'd really love to be able to ask you more about what you learned about the terminology, like bypass RAM, temperature variation, etc., but I'm not sure of the best way to contact you or if you'd even like to be bothered with it.

  8. I may be missing something, but when doing "quick" refresh why do we need to make any transition for same colour? Is there any way to send "noop" pixel. Also did you manage to control 3 color display in this way? I'm very interested in "partial" updates on epd, especialy on the 3 color epd. Also if I understand well, this code should be applicable for 7.5 display of the same company, right?

  9. Does this kind of "hack" could be applied to the 2.9 inch black and white Waveshare display version?

    Thank fouy for such a nice video and explanation

  10. Awesome article but could someone help a newbie connect up his Teensy 3.2. I cannot get it to work and I suspect my connections being incorrect. Ben could you or anyone post the pin connections required from the Waveshare to the Teensy? Thanks :)

    1. It's ok, I've fixed it now.

    2. Hello,
      Can i know how please? and wich example sketch u use?
      i have one waveshare 2.9 and one teensy.


  11. Hello! I wanted to tell you that you made a great piece of work here.

    I was wondering if you made some test with the epaper 2.9inch display regarding modifying the refresh rate. Did you get some progress with the epaper 2.9inch display? I'm currently working on a project and I require to get the fastest refresh rate as possible

  12. Hello Ben, thank you for the informative video. I was wondering if you could give me some advice. I am working on a Data Acquisition system for my Senior Design project with my two other classmates, and we are currently trying to get our E-paper displays to work with our Ardunio. What we are having trouble with, is the refresh rate is very slow, updating the screen every four seconds. Is there a simplar way to update it with your data file for e-paper to make it refresh as much as 3 times a second? I Would love to hear back from you if you can, sir. Thank you for the video and the time to read my comment. Have a nice day!

  13. @Shadowkeyblade7: Watch the video. You "just" need to change the LUTs for faster updates. You can also look at his code in the google drive share that he linked above.

    @Ben: Do you have a working link to the waveform theory with the class 7-5-7 pulse sequence? The current one just redirects me to their main index.

  14. Hi Ben, very impresive work!, i have a just a question, i have a waveshare 7.5 inch display from waveshare.

    i was looking on the firmware version for this LUTs arrays, but it seems as this display (7.5inchs) don´t work in this way, im trying to find on the specification sheet, what register or command set the this Image Upgrade times, could you took a look around this?

    fory any ideas or tips i will be very gratefu.

    Best regards.