Close

Hello World

A project log for STM32 ePaper

Playing around with ePaper and an STM32 Bluepill

Mike SzczysMike Szczys 03/19/2019 at 09:160 Comments

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.

  1. Add the STM32 support to the Arduino IDE. I'm using an STlink v2 programmer to flash the code
  2. 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.
  3. Seems there's a case-sensitve problem with these libraries. I changed the following:
    1. In epdif.cpp change "spi.h" to "SPI.h"
    2. in epdif.h change "arduino.h" to "Arduino.h"
  4. Change the pin assignments:
    1. While ediitng epdif.h, change the pin mapping as follows:
    2. #define RST_PIN         PA2
      #define DC_PIN          PA3
      #define CS_PIN          PA4
      #define BUSY_PIN        PA1
      
  5. Connect your pins (I got the pi hat adapter for this screen which breaks out the pins to female jumpers):
    1. BUSY -> PA1
    2. RST    -> PA2
    3. DC     -> PA3
    4. CS     -> PA4
    5. CLK   -> PA5
    6. DIN    -> PA7
    7. GND  -> GND
    8. VCC  -> 3v3
  6. 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

Discussions