Forum Rule: Always post complete source code & details to reproduce any issue!
Results 1 to 2 of 2

Thread: MSP2202 TFT on Teensy 4.1

  1. #1
    Junior Member
    Join Date
    Jun 2022
    Posts
    10

    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!

    Click image for larger version. 

Name:	lcdisplay_spi_tft_a-web_cropped.jpg 
Views:	0 
Size:	67.6 KB 
ID:	28726
    Last edited by MrExplore; 06-17-2022 at 09:14 PM.

  2. #2
    Junior Member
    Join Date
    Jun 2022
    Posts
    10
    - I found this library: https://github.com/KurtE/ILI9341_t3n
    - Connected the screen as shown below
    - Loaded a test sketch

    And it works

    Click image for larger version. 

Name:	TNSY41_MSP2202_connections.jpg 
Views:	5 
Size:	186.1 KB 
ID:	28728

    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) {
    
    }

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •