03/19/2019 at 09:16 •
Had some time on a plane and brought along a Bluepill (STM32F103C) and a 2.13" ePaper display.
It's pitch dark on this plane, everyone is sleeping, and had to take this with a flash so it's the best I'm going to get right now. I'll as some more when I do something novel with the display.
Sample code for this calls for Keil which doesn't run on Linux so it's a non-starter for me. I decided to give the Arduino example a try. It's for Uno but should be easy enough to get running.
- Add the STM32 support to the Arduino IDE. I'm using an STlink v2 programmer to flash the code
- There's a library that comes with the sample code which inclues epdif.h and epdif.cpp. Extract the "libraries" folder and put it in your Arduino library sketch folder (~/Arduino/libraries). Yes, you'll have a folder called "libraries" inside another folder called "libraries" but it worked for me.
- Seems there's a case-sensitve problem with these libraries. I changed the following:
- In epdif.cpp change "spi.h" to "SPI.h"
- in epdif.h change "arduino.h" to "Arduino.h"
- Change the pin assignments:
- While ediitng epdif.h, change the pin mapping as follows:
- Connect your pins (I got the pi hat adapter for this screen which breaks out the pins to female jumpers):
- BUSY -> PA1
- RST -> PA2
- DC -> PA3
- CS -> PA4
- CLK -> PA5
- DIN -> PA7
- GND -> GND
- VCC -> 3v3
- Now copy the 3pd2in13-demo folder from the demo code archive to your sketch fold and open the .ino in the Arduino IDE. When you upload the code the ePaper will come alive