Close

Communicating with an EPD

A project log for Tide Clock in MicroPython

Showing times of upcoming high/low tides using a WiPy and an E-Paper Display to try MicroPython in a project

stephen-bStephen B 03/27/2016 at 17:270 Comments

I was pretty excited when I found the EPD module for sale on digikey. It does all the generation of the weird voltages for the display and allows communication by SPI. I can do SPI! The sleep current is in nano-amps when it's off as from what I can tell the EN pin must be to a low current FET that just drops literally everything on the board.

Talking to the board was really easy in Python, I could use the REPL (read-evaluate-print-loop, the interactive shell as I think of it) to initialise the SPI module in different ways and send commands, and see whether I'm talking to it correctly. In C this is a slow process, but in Python without needing to recompile code I could work out the many many bugs I tend to bring to SPI-protocols in an hour.

Then the display didn't work at all - lots of panic ensued but happily it eventually turned out I had been too delicate with the edge connector and it needed better seating before the module would talk to the display itself.

The module is basically another micro with its own flash that can store images and update them and cycle between them with few commands to it. It doesn't entirely work in its specification (e.g. sending image data can *not* be done with a 50ns gap between packets like the datasheet says, it's more like 500us), but with some slack it does work.

Images

The image format used by the display is deliberately simple. There's a 16 byte header, and then the raw image data, one bit per pixel. So for the 400×300 display, that's 15000 image bytes, and 16 header bytes for a file size of 15016.

I haven't been able to calculate a checksum that matches the checksums that the board calculate, so I've not been able to confirm uploads to the board are correct. Comms can in theory be up to a few megabit but I've left it at 100kHz as the wiring isn't shielded.

Discussions