Git Product home page Git Product logo

stm32_tft_8bit's Introduction

STM32_TFT_8bit

8bit TFT Library for Arduino_STM32(MAPLE Core)

I ported from here.
https://github.com/prenticedavid/MCUFRIEND_kbv


Software requirement


Wirering for 8bit Parallel TFT

Using GPIOA as Data Port
#define TFT_DATA GPIOA

TFT STM32F103
LCD_RST -- PB7
LCD_CS -- PB6
LCD_RS -- PB5
LCD_WR -- PB4(*2)
LCD_RD -- PB3(*2)
LCD_D0 -- PA0
LCD_D1 -- PA1
LCD_D2 -- PA2
LCD_D3 -- PA3
LCD_D4 -- PA4
LCD_D5 -- PA5
LCD_D6 -- PA6
LCD_D7 -- PA7
5V -- 5V(*1)
3.3V -- 3.3V(*1)
GND -- GND

Using GPIOC as Data Port
#define TFT_DATA GPIOC

TFT STM32F103
LCD_RST -- PB7
LCD_CS -- PB6
LCD_RS -- PB5
LCD_WR -- PB4(*2)
LCD_RD -- PB3(*2)
LCD_D0 -- PC0
LCD_D1 -- PC1
LCD_D2 -- PC2
LCD_D3 -- PC3
LCD_D4 -- PC4
LCD_D5 -- PC5
LCD_D6 -- PC6
LCD_D7 -- PC7
5V -- 5V(*1)
3.3V -- 3.3V(*1)
GND -- GND

(*1)When a regulator(It's often AMS1117) is mounted on the back, it's operated 5V.
When a regulator is NOT mounted on the back, it's operated 3.3V.

(*2)By several boards, This port is used as JTAG.
You need remap.
afio_cfg_debug_ports(AFIO_DEBUG_NONE)

Pin define is "STM32_TFT_8bit.h"


Tested TFT

  • ILI9325 2.4inch 240x320 TFT-Shield
  • ILI9341 2.4inch 240x320 TFT-Shield
  • ILI9342 2.4inch 240x320 TFT-Shield
  • SPFD5408 2.4inch 240x320 TFT-Shield
  • R61505 2.4inch 240x320 TFT-Shield
  • ST7783 2.4inch 240x320 TFT-Shield
  • LGDP4532 2.4inch 240x320 TFT-Shield
  • R61509V 3.6inch 240x400 TFT-Shield
  • ST7793 3.6inch 240x400 TFT-Shield
  • ILI9481 3.5inch 320x480 TFT-Shield
  • ILI9486 3.5inch 320x480 TFT-Shield
  • RM68140 3.95inch 320x480 TFT-Shield
  • ST7796 3.95inch 320x480 TFT-Shield
  • OPEN-SMART ILI9225 TFT-Shield
  • OPEN-SMART ILI9327 TFT-Shield
  • OPEN-SMART ILI9340 TFT-Shield

I found that these display cannot follow high-speed GPIO-ON and GPIO-OFF.

  • OPEN-SMART S6D1121 16Pin-Parallel
  • OPEN-SMART ST7775 16Pin-Parallel
  • OPEN-SMART ST7783 16Pin-Parallel
  • OPEN-SMART R61509V 16Pin-Parallel
  • OPEN-SMART ILI9488 16Pin-Parallel

Setting your TFT's resolution

If your TFT's resolution is 320x480,
you have to set your TFT's resolution using tft.setResoution.

Example:

ID = tft.readID();
tft.setResolution(320, 480); // Set your resolution
Serial.print("Device ID: 0x"); Serial.println(ID, HEX);
tft.begin(ID);
uint32_t width = tft.width();
Serial.print("Width: "); Serial.println(width); // You will see 320
uint32_t height = tft.height();
Serial.print("Height: "); Serial.println(height); // You will see 480

If your TFT's resolution is 240x400,
you have to set your TFT's resolution and TFT's offset.

Example:

ID = tft.readID();
tft.setResolution(240, 400); // Set your resolution
tft.setOffset(32); // Set your offset
Serial.print("Device ID: 0x"); Serial.println(ID, HEX);
tft.begin(ID);
uint32_t width = tft.width();
Serial.print("Width: "); Serial.println(width); // You will see 240
uint32_t height = tft.height();
Serial.print("Height: "); Serial.println(height); // You will see 400

  • SPFD5408 + ILI9486
    8BIT_TFT-1

  • ILI9325 + ILI9481
    8BIT_TFT-2

  • ILI9341 + ST7793
    8BIT_TFT-3

  • ILI9342 + R61509V
    8BIT_TFT-4

  • ST7783 + ST7796 8BIT_TFT-5


F4 board support

If you want more faster, plase use this.
F4 board is very fast.


JPEG Viewer

Viewer of a JPEG file in the SD card.

Software requirement

Wirering for TFT built-in SD-CARD Reader

TFT STM32F103
SD_SS -- PB12
SD_SCK -- PB13
SD_DI -- PB15
SD_DO -- PB14
5V -- 5V(*)
3.3V -- 3.3V(*)
GND -- GND

*When a regulator(It's often AMS1117) is mounted on the back, it's operated 5V.
*When a regulator is NOT mounted on the back, it's operated 3.3V.

How to use

Copy JPEGS file to your SD-CARD.
*The biggest length of the JPEG file name is 32 character.
Wire TFT built-in SD-CARD Reader to STM32.
Execute JpegView_240x320_SMT32.

jpegview-2

stm32_tft_8bit's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

stm32_tft_8bit's Issues

My TFT LCD 2.8" ili9325 don't work, only white screen

Hi,
I have a TFT LCD 2.8", this TFTLCD work fine with Arduino Uno and Arduino Pro Mini and other Arduino board with library and examples of https://github.com/adafruit/TFTLCD-Library
in Arduino Pro Mini serial port show this: :-)
Using Adafruit 2.8" TFT Breakout Board Pinout
TFT size is 240x320
Found ILI9341 LCD driver
...
Wiring in Arduino boards is:
LCD_CS --> A3, LCD_CD --> A2, LCD_WR --> A1, LCD_RD --> A0, LCD_RESET --> A4
and 8 data lines is:
D0 --> 8, D1 --> 9, D2 --> 2, D3 --> 3, D4 --> 4, D5 --> 5, D6 --> 6, D7 -->7

I use this code:
https://github.com/adafruit/TFTLCD-Library/blob/master/examples/graphicstest/graphicstest.pde

Now I have an STM32 (STM32F103C8T6) header board and wiring is:
LCD_RST ---> PB7, LCD_CS ---> PB6, LCD_RS ---> PB5, LCD_WR ---> PB4, LCD_RD ---> PB3
LCD_D0 ---> PA0, LCD_D1 ---> PA1, LCD_D2 ---> PA2, LCD_D3 ---> PA3, LCD_D4 ---> PA4, LCD_D5 ---> PA5, LCD_D6 ---> PA6, LCD_D7 ---> PA7, 5V ---> 5V, 3.3V ---> 3.3V, GND ---> GND

I use this code:
https://github.com/nopnop2002/STM32_TFT_8bit/blob/master/examples/GraphicsTest_240x320_SMT32/GraphicsTest_240x320_SMT32.ino

in STM32F103C8T6 header board serial port show this: :-(
STM32_TFT_8bit Test!
readReg16(0)=0x0
readReg32(A1)=0x0
readReg40(BF)=0xffff
readReg32(D4)=0x0
readReg40(EF)=0x0
readReg32(FE)=0xfe
readReg32(04)=0x0
readReg32(D3)=0x0
readReg16(0)=0x0
Device ID: 0x0
Width: 240
Height: 320
...
what is the problem, why my TFTLCD is only white ?!

http://xint.ir/fg5/repository/laser/Images/2.4_TFTLCD_Shield_i.jpg

http://xint.ir/fg5/repository/laser/Images/2.4_TFTLCD_Shield_ii.jpg

please help me,
Thanks so much

Performance / Benchmarks

Hi,

Thanks for sharing this library. I'm trying to pick a display / controller and wondering if you can share any performance / benchmarks for the various displays & modes (SPI / 8-bit parallel) supported.

Cheers

nucleo-64 error on loading

I have a core-64 stm32f103rb card, but in loading it gives me the error:
/home/user/Arduino/libraries/STM32_TFT_8bit-master/STM32_TFT_8bit.cpp:23:26: fatal error: libmaple / dma.h: No such file or directory
ย #include <libmaple / dma.h>
how can i fix it?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.