Updated guides have been published for the different sizes of eInk Breakouts, Shields, and FeatherWings:
Wiring
Wiring up the display in SPI mode is pretty easy as there's not that many pins! We'll be using hardware SPI, but you can also use software SPI (any pins) later.
Start by connecting the power pins
- 3-5V Vin connects to the microcontroller board's 5V or 3.3V power supply pin
- GND connects to ground
Required SPI Pins
These use the hardware SPI interface and is required so check your microcontroller board to see which pins are hardware SPI
- CLK connects to SPI clock. On Arduino Uno/Duemilanove/328-based, thats Digital 13. (For other Arduino-compatibles See SPI Connections for more details)
- MISO connects to SPI MISO. On Arduino Uno/Duemilanove/328-based, thats Digital 12. (For other Arduino-compatibles See SPI Connections for more details)
- MOSI connects to SPI MOSI. On Arduino Uno/Duemilanove/328-based, thats Digital 11. (For other Arduino-compatibles See SPI Connections for more details)
Other Digital I/O Pins
These can be set in the sketch to any pins you like but to follow the exact example code we'll use the following:
- ECS connects to our e-Ink Chip Select pin. We'll be using Digital 10 but you can later change this to any pin
- D/C connects to our e-Ink data/command select pin. We'll be using Digital 9 but you can later change this pin too.
- SRCS connects to our SRAM Chip Select pin. We'll be using Digital 8 but you can later change this to any pin
- RST connects to our e-Ink reset pin. We'll be using Digital 5 but you can later change this pin too.
- BUSY connects to our e-Ink busy pin. We'll be using Digital 3 but you can later change this pin too.
Load First Demo
Open up File→Examples→Adafruit_EPD→EPDTest
If you have the FeatherWing open up File→Examples→Adafruit_EPD→FeatherWingTest
At the top of the sketch find the lines that look like:
/* Uncomment the following line if you are using 1.54" tricolor EPD */ Adafruit_IL0373 display(152, 152 ,EPD_DC, EPD_RESET, EPD_CS, SRAM_CS, EPD_BUSY); /* Uncomment the following line if you are using 2.13" tricolor EPD */ //Adafruit_IL0373 display(212, 104 ,EPD_DC, EPD_RESET, EPD_CS, SRAM_CS, EPD_BUSY); /* Uncomment the following line if you are using 2.7" tricolor EPD */ //Adafruit_IL91874 display(264, 176 ,EPD_DC, EPD_RESET, EPD_CS, SRAM_CS);
And uncomment the matching object for the screen chipset and resolution you will be using. Then upload to your microcontroller wired up to the display
You will see the display flash a bunch and then a set of black and red lines will appear like shown on the left.
If you see the lines, your wiring is good! If not, go back and check your wiring to make sure its correct. If you didn't use the default pins, change them in the sketch
Load Graphics Test Demo
Open up File→Examples→Adafruit_EPD→graphicstest and upload to your microcontroller wired up to the display
If you're using a FeatherWing, use the pin definitions from the top of FeatherWingTest, for example:
#ifdef ESP8266
#define SD_CS 2
#define SRAM_CS 16
#define EPD_CS 0
#define EPD_DC 15
#endif
and copy those into the top of the graphics test sketch
This time you will see the display going through a range of tests, from pixels, lines, text circles etc.
This shows all the different shapes and techniques you can use that come with the Adafruit GFX library! Unlike most e-paper displays, where you can only draw an image, the built in SRAM lets you have full control over what shows up on the eInk screen.
Unnecessary Pins
Once you've gotten everything working you can experiment with removing the RST and BUSY pins. We recommend tying RST to your microcontroller's Reset line so the eInk display is reset when the microcontrollers is. The busy pin makes startup a little faster but we don't find it to be essential
You can set the code as below to remove control of those pins from the Adafruit_EPD library:
#define EPD_RESET -1 // can set to -1 and share with microcontroller Reset! #define EPD_BUSY -1 // can set to -1 to not use a pin (will wait a fixed delay)
Thus saving you two pins!
Note that the 2.7" Tri-color display works best if you have a reset pin, it really likes being reset before sending data, so we recommend keeping it.
Text editor powered by tinymce.