Look for in our Blog. You will find multiple applications, solutions, code examples. Navigate using the tag cloud or search using specific criteria

How to connect and program RA8875 Touch Display Driver Board for 7" Panel

Introduction

In this post we will control the speed of a stepper motor (Nema 17HS16-2004S) using a rotary encoder (LPD3806-600bm). For this we will also need a driver for the stepper motor that will be connected to our Arduino based PLC for the automation of the speed control. For the software, a pulses.h library is implemented (software without using pulses.h library is also attached).


Requirements

 Ethernet PLC or  20I/Os PLC

Adafruit GFX Library

RA8875 Touch Display + Touch Screen

Adafruit RA8875 Library

RA8875 Library


Description

RA8875 Driver 

The RA8875 is a powerful TFT driver chip. It is a perfect match for any chip that wants to draw on a big TFT screen but doesn't quite have the mph (whether it be hardware or speed). Inside is 768KB of RAM, so it can buffer the display (and depending on the screen size also have double overlaying). The interface is SPI with a very basic register read/write method of communication (no strange and convoluted packets). 

The RA8875 can also handle standard 4-wire resistive touchscreens over the same SPI interface to save you pins. There's an IRQ pin that you can use to help manage touch interrupts.

On the PCB we have the main chip, level shifting so you can use safely with 3-5V logic. There is also a 3V regulator to provide clean power to the chip and the display. For the backlight, we put a constant-current booster that can provide 25mA or 50mA at up to 24V. The connector to the screen is a classic '40 pin' connector. 


Connections


M-Duino Family PLC / Ardbox Family PLC PinoutRA8875 Pinout
5 VVIN
GNDGND
SCKSCK
SO MISO
SIMOSI
RX1 (Serial 1) or using Software SerialCS
Pin3 (Some 5V pin)RESET
INTINT1


Examples


With the RA8875 library you have a wide variety of examples. For this bloc we used the clock example.



Before upload the program to your M-Duino/Ardbox it's necessary to change the RA8875_CS define pin by 19 (RX1), RS8875_RESET define pin by 3 (Pin 3) and change tft.begin(RA8875_800x480) by tft.begin(Adafruit_800x480, 8) from setup function. The last change is because there're different resolution configurations and this one is better for the TFT screen. 


Here you have another example which displays "Industrial Shields" in the center in green color. 


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

#define RA8875_CS 19

#define RA8875_RESET 3//any pin or nothing!

RA8875 tft = RA8875(RA8875_CS, RA8875_RESET);

void setup() {
  // put your setup code here, to run once:
  tft.begin(Adafruit_800x480, 8);

  tft.fillWindow();
  tft.setCursor(CENTER, CENTER); // tft.setCursor(X_axis, Y_axis); 
  tft.setTextColor(RA8875_GREEN); // 
  tft.setFontScale(3);
  tft.println("Industrial Shields");
}

void loop() {
  // put your main code here, to run repeatedly: 
  
  tft.setTextColor(RA8875_GREEN);
}


That's the result: