Giter Site home page Giter Site logo

stm32-fsmc-ili9341-lib's Introduction

STM32-FSMC-ILI9341_Lib

This is a library for those LCDs using 16-bit parallel interface based on ILI9341.

Actually there isn't much information about HAL's FSMC's usage in LCD controller.
I have referred articles below and they did a lot help to me:

About FSMC in emWin
Martnak's ILI9341 Lib

Martnak's lib is based on SPI and in some occasions it's quite slow. So FSMC is a good choice to drive a high-speed lcd display.

How to use

Configure FSMC in cubeMX and other necessary params(For details you can look into the demo in the repo.)

And Generate Code, I use Clion + cmake to build project so i choose SW4STM32.

Then follow the procedure below :

  1. include "ili9341.h" in main.c
  2. refer ILI9341_Init(); in main() function(before while (1)).
  3. refer ILI9341_Test(); in while(1) to test whether it's fine.
  4. Enjoy :)

Notes

FSMC parameters generated by cubeMx is not quite perfect for lcd displays.
If you want faster speed, you can change the params in Src/fsmc.c 's MX_FSMC_Init() function

Here is an example:

//params generated be cubeMx automatically
/*
Timing.AddressSetupTime = 15;
Timing.AddressHoldTime = 15;
Timing.DataSetupTime = 255;
Timing.BusTurnAroundDuration = 15;
Timing.CLKDivision = 16;
Timing.DataLatency = 17;
*/

//Changed value as below
Timing.AddressSetupTime = 2;
Timing.AddressHoldTime = 2;
Timing.DataSetupTime = 16;
Timing.BusTurnAroundDuration = 2;
Timing.CLKDivision = 16;
Timing.DataLatency = 2;

This will improve the display speed a lot. Hope it helps.

PinMaps

STM32 ILI9341_LCD Comment
FSMC_Dx DBx 16 pins in total
FSMC_NOE LCD_RD Read
FSMC_NWE LCD_WR Write
FSMC_NEx LCD_CS Chip select
FSMC_Ax LCD_RS Register Select (Not Reset!)
User defined RST pin LCD_RST Reset

stm32-fsmc-ili9341-lib's People

Contributors

floyd-fish avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

stm32-fsmc-ili9341-lib's Issues

Example code is not upgradable to STM32CubeMX 6.5

When opening the .ioc file:

"This project was setup with STM32CubeMX V5.5.0 using STMCube FW_F4 V1.24.2
STM32CubeMX V6.9.0 can work with STM32CUbe FW_F4 V1.27.1

There are 2 options to proceed:

  • Migrate: Migrate your project using the current STM32CubeMX version (6.9.0) and STM32Cube FW V1.27.1
  • Continue: Continue to stay compatible with the old STM32CubeMX version 5.5.0. and STM32Cube V1.24.0"

Both options fail: Migrate & continue fail.

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.