Skip to content

Connecting the Adafruit RA8875 to your controller (and this library)

max mc costa edited this page Jul 5, 2015 · 7 revisions

The Adafruit RA8875 controller https://www.adafruit.com/product/1590 it's a RA8875 with a 4050 level converter and a regulator, nothing else, it has no Font Chip option, Keyboard Matrix, Flash Chip but has support for internal resistive touch controller. It doesn't have the display so you need to buy this first!
The RST pin should be connected since (in contrast to EastRising) it doesn't have the reset circuit.
Adafruit choose to use the RA8875 GPIO1 (2 port, but just one used) for generate PWM for display so this library have a special initialization for this board that enable PWM1 as adafruit request:

  • Adafruit_480x272
  • Adafruit_800x480

As almost all RA8875 design even this one have the MISO non-tristate hardware bug (at list at the time I'm writing this) but remember that this chip works in SPImode3 so it should be isolated from other SPI devices to avoid problems
I always admire Adafruit stuff, well made, but this it's not my preferred design, it cost a fortune since you need to add a display and you need a lot of extra connections for Touch, also the lack of optional stuff like SPI Flash chip and Matrix keyboard plus the complicated wiring caused by all those wires for me it's a big no no no. For the same cost of this board you can have a complete display from ebay with all the extra feautures as well, maybe not same quality but for DIY who cares?

Connections:

  • Vin: +5V
  • GND: GND
  • 3Vo: not connected (or use for the SPI fix circuit described in wiki)
  • Lite: not connected
  • SCK: SPI SCK
  • MISO: SPI MISO (remember that it's not tristate! see SPI fix circuit if you want add some SPI device)
  • MOSI: SPI MOSI
  • CS: SPI CS
  • RST: Any MCU Pin or 10K resistor tied to 3V3 (or 5V? not sure)
  • WAIT: Not used
  • INT: Any MCU pin
  • Y+: Used for resistive Touch Screen
  • Y-: Used for resistive Touch Screen
  • X+: Used for resistive Touch Screen
  • Y-: Used for resistive Touch Screen

** Sketch:**

Start by including libraries:

#include <SPI.h>
#include <RA8875.h>

Now define pin used:

#define RA8875_INT 3//any pin
#define RA8875_CS  2//restriction for Teensy3 and CS
#define RA8875_RST 7//any pin

Now instance:

RA8875 tft = RA8875(RA8875_CS,RA8875_RST);
//can be optionally RA8875 tft = RA8875(RA8875_CS,RA8875_RST,true,true);
//if you have a Teensy3 and need to use alternative SCK and MOSI outs

Now the setup:

void setup() {
  tft.begin(Adafruit_480x272);//or Adafruit_800x480


  //bla bla
}

then your loop:

void loop(){
}

The begin will automatically setup SPI as needs, initialize display and set is black.