nopnop2002 / arduino-stm32-8bittft Goto Github PK
View Code? Open in Web Editor NEW8bit parallel TFT Library for Arduino_Core_STM32
License: Apache License 2.0
8bit parallel TFT Library for Arduino_Core_STM32
License: Apache License 2.0
Hey!
I am using STM32F407VET6 board: https://stm32-base.org/boards/STM32F407VET6-STM32-F4VE-V2.0
This board has a 16-bit FSMC interface.
This interface makes it easier to work with the TFT display and significantly speed up drawing on the display.
I found the only library that works with this interface: https://github.com/stevstrong/Adafruit_TFTLCD_16bit_STM32
The library is running and the display shows an image.
But this library only works with Arduino_STM32 core: https://github.com/rogerclarkmelbourne/Arduino_STM32
But this is not a complete core. Support for F407 series microcontrollers is very limited. Many functions do not work correctly or do not work at all.
Arduino_Core_STM32 core is very good: https://github.com/stm32duino/Arduino_Core_STM32
But I did not find support for TFT displays with FSMC in it.
Can you modify the library to support 16-bit displays with FSMC interface?
I've got an Open-Smart 16 pin ILI9488 3.5inch 320x480 "expansion module" from e-bay.
https://www.ebay.com/itm/3-5inch-TFT-Board-Expansion-Module-LCD-Touch-Screen-For-R3-Nano-Mega2560-Hot/233641518844?ssPageName=STRK%3AMEBIDX%3AIT&_trksid=p2057872.m2749.l2649
I hooked it up to a Black Pill STM32F411CE.
I looked at the .cpp and saw it briefly mentioned the ILI9488 but I'm not sure if it supports it. (I don't really understand the code.) I'm probably doing something wrong.
I ran the GraphicsTest_320x480_SMT32.ino and it looks like it is communicating with each other but there is nothing on the tft screen. In the Serial Monitor I am seeing this;
Arduino-STM32-8bitTFT
readReg16(0)=0x0
readReg32(A1)=0x3093
readReg40(BF)=0x9393
readReg32(D4)=0x0
readReg40(EF)=0x0
readReg32(FE)=0x0
readReg32(04)=0x548066
readReg32(D3)=0x9488
Device ID: 0x9488
Width: 320
Height: 480
Benchmark Time (microseconds)
Screen fill 2115372
Text 77333
Lines 962493
Horiz/Vert Lines 182033
Rectangles (outline) 108761
Rectangles (filled) 5310698
Circles (filled) 1258549
Circles (outline) 411223
Triangles (outline) 194504
Triangles (filled) 1925425
Rounded rects (outline) 197330
Rounded rects (filled) 5885654
Done!
Thank you in advance for any help you could give me.
Doug
I have an ILI9225 Parallel TFT 2.0" display with the following wiring, but i only see white screen with STM32F401 MCU.
D0-D7 -> PA0->PA7, TFT_CS -> PB8, TFT_DC -> PB5, TFT_RST -> PB9, TFT_WR -> PB1, TFT_RD -> PB0
I use this config:
#define TFT_DATA GPIOA
#define TFT_PORT PORT_LOW
#define TFT_D0 LL_GPIO_PIN_0
#define TFT_D1 LL_GPIO_PIN_1
#define TFT_D2 LL_GPIO_PIN_2
#define TFT_D3 LL_GPIO_PIN_3
#define TFT_D4 LL_GPIO_PIN_4
#define TFT_D5 LL_GPIO_PIN_5
#define TFT_D6 LL_GPIO_PIN_6
#define TFT_D7 LL_GPIO_PIN_7
#define TFT_RD LL_GPIO_PIN_0
#define TFT_WR LL_GPIO_PIN_1
#define TFT_RS LL_GPIO_PIN_5
#define TFT_CS LL_GPIO_PIN_8
#define TFT_RST LL_GPIO_PIN_9
An ILI9341 display works fine with the same setup.
Is the ILI9225 display not supported?
(The ILI9225 display also works with the TFT_eSPI library)
readReg40(BF)=0x0
readReg32(D4)=0x0
readReg40(EF)=0x1818
readReg32(FE)=0x0
readReg32(04)=0x0
readReg32(D3)=0x0
readReg16(0)=0x9226
Device ID: 0x9226
Width: 176
Height: 220
Code in example doesn't work on stm32f401ccu6 v3.0 + display ILI9486 with core from ST
After the code LCD_ID_Reader.ino
is executed, i.e. the pins are connected correctly, the ID is readable.
reg(0x00D3) 00 00 94 86.ILI9341, ILI9488
I connected black pill to display as below:
TFT | STM32 | |
---|---|---|
LCD_RD | -- | PB0(*1) |
LCD_WR | -- | PB1(*1) |
LCD_RS | -- | PB5(*1) |
LCD_CS | -- | PB6(*1) |
LCD_RST | -- | PB7(*1) |
LCD_D0 | -- | PA0(*2) |
LCD_D1 | -- | PA1(*2) |
LCD_D2 | -- | PA2(*2) |
LCD_D3 | -- | PA3(*2) |
LCD_D4 | -- | PA4(*2) |
LCD_D5 | -- | PA5(*2) |
LCD_D6 | -- | PA6(*2) |
LCD_D7 | -- | PA7(*2) |
#define TFT_RD LL_GPIO_PIN_0 // Px0
#define TFT_WR LL_GPIO_PIN_1 // Px1
#define TFT_RS LL_GPIO_PIN_5 // Px5
#define TFT_CS LL_GPIO_PIN_6 // Px6
#define TFT_RST LL_GPIO_PIN_7 // Px7
White screen.
I connected black pill to display as below:
TFT | STM32 | |
---|---|---|
LCD_RD | -- | PB3(*1) |
LCD_WR | -- | PB4(*1) |
LCD_RS | -- | PB5(*1) |
LCD_CS | -- | PB6(*1) |
LCD_RST | -- | PB7(*1) |
LCD_D0 | -- | PA0(*2) |
LCD_D1 | -- | PA1(*2) |
LCD_D2 | -- | PA2(*2) |
LCD_D3 | -- | PA3(*2) |
LCD_D4 | -- | PA4(*2) |
LCD_D5 | -- | PA5(*2) |
LCD_D6 | -- | PA6(*2) |
LCD_D7 | -- | PA7(*2) |
#define TFT_RD LL_GPIO_PIN_3 // Px3
#define TFT_WR LL_GPIO_PIN_4 // Px4
#define TFT_RS LL_GPIO_PIN_5 // Px5
#define TFT_CS LL_GPIO_PIN_6 // Px6
#define TFT_RST LL_GPIO_PIN_7 // Px7
Screen white also...
Same hardware work good with TFT_eSPI and pins as below:
// common "MCUfriend" shields
#define TFT_CS PB8 // Chip select control pin
#define TFT_DC PB7 // Data Command control pin
#define TFT_RST PB9 // Reset pin
#define TFT_WR PB6 // Write strobe control pin
#define TFT_RD PB0 // Read pin
#define TFT_D0 PA0 // 8 bit parallel bus to TFT
#define TFT_D1 PA1
#define TFT_D2 PA2
#define TFT_D3 PA3
#define TFT_D4 PA4
#define TFT_D5 PA5
#define TFT_D6 PA6
#define TFT_D7 PA7
I changed in the library TFT_eSPI pins as for the library and everything worked.
#define TFT_RD PB0 // Read pin
#define TFT_WR PB1 // Write strobe control pin
#define TFT_DC PB5 // RS/CD - Data Command control pin
#define TFT_CS PB6 // Chip select control pin
#define TFT_RST PB7 // Reset pin
#define TFT_D0 PA0 // 8 bit parallel bus to TFT
#define TFT_D1 PA1
#define TFT_D2 PA2
#define TFT_D3 PA3
#define TFT_D4 PA4
#define TFT_D5 PA5
#define TFT_D6 PA6
#define TFT_D7 PA7
When I changed the pins in various options for the library Arduino-STM32-8bitTFT nothing worked and the screen was still white.
You write that the library works with ILI9486, but I did not find initialization in the code, for ILI9481 only:
case 0x9481: //ILI9481
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.