MSP2202 TFT on Teensy 4.1

MrExplore

Member
TFT display on Teensy 4.1 (MSP2202 - 9 pins)

Hi all,,

I'm new to the forum and new to the world of Teensy. Not completely new to the world of electronics and uc's though but the Teensy 4.1 is my first Teensy :)

I allready soldered the ethernetkit together and tested the webserver NativeEthernet example, yay it works.

My next goal is to get a TFT screen to work. It's an MSP 2202 (ILI9341 240x320 SPI TFT, 9 pins)

My question is, what library can I use? (in the Arduino IDE)

Thanks!

lcdisplay_spi_tft_a-web_cropped.jpg
 
Last edited:
- I found this library: https://github.com/KurtE/ILI9341_t3n
- Connected the screen as shown below
- Loaded a test sketch

And it works :)

TNSY41_MSP2202_connections.jpg

Code:
#include <SPI.h>
#include <ILI9341_t3n.h>
#include <ili9341_t3n_font_ComicSansMS.h>

#define TFT_CS              10
#define TFT_DC              20
#define TFT_MOSI            11
#define TFT_CLK             13
#define TFT_RST             255
#define TFT_MISO            12
#define TFT_BACKLIGHT       3           // Any PWM pin will do, use to set level of backlight 0-255

ILI9341_t3n tft = ILI9341_t3n(TFT_CS, TFT_DC, TFT_RST, TFT_MOSI, TFT_CLK, TFT_MISO);


void setup() {

  Serial.begin(9600);

  pinMode(TFT_BACKLIGHT, OUTPUT);
  analogWrite(TFT_BACKLIGHT, 100);
 
  tft.begin();
  tft.setRotation(3);
  
  tft.fillScreen(ILI9341_BLACK);
  //while (!Serial) ; 
  tft.setTextColor(ILI9341_WHITE);  tft.setTextSize(1);
  tft.enableScroll();
  tft.setScrollTextArea(0,0,120,240);
  tft.setScrollBackgroundColor(ILI9341_GREEN);

  tft.setCursor(180, 100);

  tft.setFont(ComicSansMS_12);
  tft.print("Fixed text");

  tft.setCursor(0, 0);

  tft.setTextColor(ILI9341_BLACK); 

  for(int i=0;i<20;i++){
    tft.print("  this is line ");
    tft.println(i);
    delay(100);
  }

  tft.fillScreen(ILI9341_BLACK);
  tft.setScrollTextArea(0,0,120,120);
  tft.setScrollBackgroundColor(ILI9341_GREEN);
  tft.setFont(ComicSansMS_10);

  tft.setTextSize(1);
  tft.setCursor(40, 50);

  for(int i=0;i<20;i++){
    tft.print("  this is line ");
    tft.println(i);
    delay(500);
  }

}

void loop(void) {

}
 
Back
Top