LCD Identification
Under the LCD it has CL9325-115 on the ribbon. It is part of original Jyetech DSO-138 kit I got some years ago from Banggood. Most of these originally seem to be with 9341. I tried to get its ID over serial with readID(); sometimes it reports strange numbers, for example 1690 hex, 4112 dec/1010 hex.
Getting LCD to display something other than white screen
For some reason I don't understand, only the TFT code from DLO-138 project partial works after changing the display to 0x9325. I tried compiling with earlier version of GFX library as per the instructions but it only gave white screen.

Since the screen looks so close, I was wondering does anyone have an intuition as what might be wrong? There are lots of vertical white lines on most of the screen area that aren't drawable (yet some of the DLO-138 code is able to draw in this area). I tried to draw the text 400px lower and it only made the upper area black.
I tried starting fresh with original Stevestrong TFT code from Github, changing the pin values in Adafruit_TFTLCD_8bit_STM32.h
that I confirmed with schematic and very simple sketch. But I just get white screen.
Code: Select all
//src/stevestrong/Adafruit_TFTLCD_8bit_STM32.h
// from DLO-138 tft
#define TFT_RD PB10
#define TFT_WR PC15
#define TFT_RS PC14
#define TFT_CS PC13
#define TFT_RST PB11
Arduino 1.8.19
Arduino SAM Boards 1.6.2
Adafruit GFX 1.2.7 (the DLO-138 code did not work for me with GFX 1.1.4 using 0x9325, I only got white screen)
Using STM32 Flash loader as I had to put AFIO_DEBUG_NONE to get the LED to blink, which made it impossible to connect via SWD pins/STlink adapter.
My test code:
Code: Select all
#include <Adafruit_GFX.h>
// i'm going to use 1.2.7 as 1.1.4 gave only white screen
#include "src/TFTLib/Adafruit_TFTLCD_8bit_STM32.h"
// from https://github.com/ardyesp/DLO-138/tree/master/src/TFTLib
// try the one from github stevestrong
//#include "src/stevestrong/Adafruit_TFTLCD_8bit_STM32.h"
// only get white screen
#define ledPin PA15
// TFT display constants
#define PORTRAIT 0
#define LANDSCAPE 3
#define TFT_WIDTH 320
#define TFT_HEIGHT 240
//in portrait 0 I get strange flickering, text begins at piscing
// need for stevestrong repo
//#define ILI9341_BLACK 0x0000
//#define ILI9341_WHITE 0xFFFF
#define ipsum "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum."
//--------------------led stuff
int ledState = LOW; // ledState used to set the LED
unsigned long previousMillis = 0; // will store last time LED was updated
#define yalign 0
// doesn't matter if unsigned int or #define
// xalign still appears ever so slightly lower
// yalign 400 you cant see the text at all, black region top
// constants won't change:
const long interval = 1000; // interval at which to blink (milliseconds)
Adafruit_TFTLCD_8bit_STM32 tft;
//low bits i get text and weird blank screen bit below
//try high bits? nope i get nothing.
void setup() {
// set the digital pin as output:
pinMode(ledPin, OUTPUT);
// try this with serial only
afio_cfg_debug_ports(AFIO_DEBUG_NONE);
// led works with this AFIO_DEBUG_NONE
// init display
tft.reset();
// tft.begin(0x9341);
tft.begin(0x9325);
// 0x9325
// 0x8357
// 0x8347
tft.setRotation(LANDSCAPE);
tft.fillScreen(ILI9341_BLACK);
}
void loop() {
tft.setCursor(0, yalign);
tft.setTextColor(ILI9341_WHITE, ILI9341_BLACK);
tft.print(ipsum);
unsigned long currentMillis = millis();
if (currentMillis - previousMillis >= interval) {
previousMillis = currentMillis;
// if the LED is off turn it on and vice-versa:
if (ledState == LOW) {
ledState = HIGH;
} else {
ledState = LOW;
}
// set the LED with the ledState of the variable:
digitalWrite(ledPin, ledState);
}
}