THANK YOU SO MUCH! I got it working with the DevEBox STM32F407 breakout board with the 16-bit-interface TFT_320QVT_9341 display board! With your linked code and some tweaks for my setup I get exactly the same thing shown at 16:41! I had to change the data address 0x6004000 to 0x6002000 to use with my particular Register Select A16 setting per 6:47 ("Understanding FSMC addressing" paragraph). I also think that after HAL_GPIO_WritePin(RST_GPIO_Port, RST_Pin, GPIO_PIN_SET); in main.c there should be added another HAL_Delay(10); after raising the Reset line, but doesn't seem necessary from experimentation. I made a couple more tweaks to change to a 16-bit interface, changing *(__IO uint8_t *) to *(__IO uint16_t *) in the SendCommand/SendData functions, and adding another SendData function for 16-bit color data and editing the printImage function to combine the upper/lower bytes. 3:34 changing these timing settings from the 15/255/15 default settings sped up the drawings a lot. My circle function still seems a liiiitle bit slower than what's shown in the video. www.amazon.com/gp/product/B081BCXST2/ref=ppx_od_dt_b_asin_title_s00?ie=UTF8&psc=1 www.amazon.com/DIYmalls-ILI9341-Display-Resistive-320x240/dp/B086ZK6VG5/ref=cm_cr_arp_d_product_top?ie=UTF8
@mUbase5 жыл бұрын
Thank you so much for describing the FSMC and ILI9341 and how to use it in Cube. I am using an STM3220G Eval board which uses a 3.2" LCD and the ili9325 drivers but its very similar to your driver in the way of functionality. Thanks again. :)
@AB-zh6lp5 жыл бұрын
Thanks for that. Makes it easy to start my first STM project. Project, Presentation very good
@erqiangtang99284 жыл бұрын
Very helpful tutorial. Thank you so much :)!
@prashkd76844 жыл бұрын
I've got all the hardware required for this project. Now i just need to find some time to get started with it.
@hoangphamtranminh6 жыл бұрын
First of all, you're my best online teacher. I've learned many things from you. Your code always work! I'm done with displaying on lcd and now i want to do some touch things on this. Do you have library for that? Or can you give me some suggestions how to do that? Anyway, thank you
@mutexembedded22066 жыл бұрын
Hi Hoang, Thanks for the nice words. I am planning to make a video about that, but might not be very soon though, sorry. But for now, check this out: core-electronics.com.au/resistive-touch-screen-controller-stmpe610.html
@iquitnow16 жыл бұрын
Hi do have any tutorials for using the LCD on the stm32f429 discovery board
@luizajakostam78033 жыл бұрын
you are my hero, thank you so much
@mutexembedded22063 жыл бұрын
Thanks for the kind comment :)
@rajeshn26002 жыл бұрын
Thanks for the useful tutorial. Can I use the mentioned libraries (MA_ILI9341.h and MA_ILI9341.c) for interfacing my 3.2" LCD display having ILI9341 driver IC with STM32F401 based Nucleo-64 board through SPI?
@chloemcholoe32805 жыл бұрын
wow. i did all those stuff by hand before. the cubemx looks so easy..
@bascom18583 жыл бұрын
need a bit help. i use a 320x480 display how to modify,
@mutexembedded22063 жыл бұрын
Look at low level code related to size, need to adjust it accordingly.
@abbasnajam69354 жыл бұрын
Hello! I'm using HVGA 3.2 Arduino Sheild and wanted to use 16 bit can you tell how can i convert these drivers for 16 bit. The LCD is working with 8 bits but not properly. If you could help.
@mutexembedded22064 жыл бұрын
Hi, It uses ILI9481 driver, so need to program that a bit first.
@hakid314 Жыл бұрын
How do I have to alter the code for using it with STM32F746? I already tried just changing the stm32f4 HAL to f7 and generated code in CubeMX for f7 accordingly, but it doesn‘t work.
@usrrsr4 жыл бұрын
Modify the code with touchgfx gui builder. This will be best initiative never done before. It exist only in document but no source code with tutorials.
@jonathanrodriguez82193 жыл бұрын
Hi Muhammed, Do you have for 16-bit FSMC??
@ameliabuns40584 жыл бұрын
My board has NE4 Wired up to the LCD interface and I can't figure out where to find the figured in the datasheet no matter where I look. I also don't understand what "banks are". EDIT: Oh sections!
@jakubstencel23143 жыл бұрын
what changes need to be made in this library to run the 16bit display with FSMC ?
@pankajkande41414 жыл бұрын
I checked all rotation but my lcd shows Mirror image. what can i do to get proper text.
@m.j.49246 жыл бұрын
Hi, Is it possible to connect a TFT LCD ILI9225 or any other with an ISP to a NUCLEO unit, or whether there is a library for this TFT LCD. I am also interested in what sample FFT for NUCLEO boards. I use NUCLEO-144, STM32F767ZIT. best regards
@mutexembedded22066 жыл бұрын
LMM LIGHT MY MUSIC Yes, it is possible of course.. as long as you have Parallel interface (8bits or 16 bits). You need to do the initialization sequence of the ili9225; you effectively need to have your own LCD driver but the FSMC Write concept is the same. Good Luck
@hooligun904 жыл бұрын
Hello, I have a 16 bit screen. Do i have to change parrameters in the .c and .h file?
@HB9GZE6 жыл бұрын
thx a lot; followed yr instructions and the code and I got it to work! thx for sharing!
@vipultyagi65905 жыл бұрын
Can i interface stm32f407 to a 7inch resistive touch display using the same library files..?
@sayalijoshi50104 жыл бұрын
Hello, Sir actually I want to interface this arduino shield with stm32f407vg using touchscreen. Could you please help me out. I am not getting any good reference.
@slojanko5 жыл бұрын
Great tutorial, the LCD works great except for me unable to write some specific colors, like 0x001F turns the screen white and I can't do anything unless I reset the STM board. Would you happen to know why this happens?
@mutexembedded22065 жыл бұрын
Hi, Sorry for later reply.. that could be overclocking or long wires
@slojanko5 жыл бұрын
Thank you, the newest version of CubeMX has output speed values along with FSMC so I played with those a bit. I also switched to TrueSTUDIO which is a free and without limits alternative to uVision.
@slojanko5 жыл бұрын
So I'm looking at the datasheet of the display and was wondering if it was possible to write the entire frame to the display, then request a refresh to avoid the huge tearing I'm currently having. There seems to be no mention of this being possible, would you know anything about this?
@kingame696 жыл бұрын
is there any difference between fsmc and fmc ILI9341 2.4' display interface
@TheAlfe285 жыл бұрын
Hi, I have a tft display with ILI9325 driver. I followed the steps in the video, but only the back white lights worked. How do I run this screen?
@mutexembedded22065 жыл бұрын
Cannot run ILI9325 with this library,, it is meant to be for the ILI9341 only.
@sindujatenth5 жыл бұрын
@@mutexembedded2206 Do you have any suggestions to modify this for ILI9325? Or do you know where to find library for ILI9325.
@mutexembedded22065 жыл бұрын
@@sindujatenth Hi, I often look for Github open source libraries and port them to STM32, if I did not like their structure I write them from scratch. Start with Github, you should be able to port them. GL
@baldebaldemord95883 жыл бұрын
It's probably a bit late to ask, but do you think It's possible to achive a decent frame-rate with bit-banging? I don't have a fsmc on my Chip (STM32f405RGT6).
@mutexembedded22063 жыл бұрын
Yes.. for gui. For video, not sure
@baldebaldemord95883 жыл бұрын
@@mutexembedded2206 I got It to work finally! With your code as foundation I only had to implement SendCommand and Send Data. Here is what worked for me: //1. Write Command to LCD void ILI9341_SendCommand(uint8_t com) { SELECT(); GPIOC->BSRR = (uint32_t) 0xFF0 BSRR = com BSRR = (uint32_t) 0xFF0 BSRR = data BSRR = (uint32_t) GPIO_PIN_15 BSRR = GPIO_PIN_15 #define WR_HIGH GPIOA->BSRR = GPIO_PIN_9 // WR on PA9 #define WR_LOW GPIOA->BSRR = (uint32_t) GPIO_PIN_9 BSRR = GPIO_PIN_10 // RS on PA10 #define RS_LOW GPIOA->BSRR = (uint32_t) GPIO_PIN_10 BSRR = GPIO_PIN_8 // RD on PA8 You also have to change the Init function as follows: void ILI9341_Init(void) { WR_HIGH; RS_HIGH; RD_HIGH; . . . } I did reset the display on the RST line but did not put it in the Init function. I'm using PC4-11 as the data lines, but you can take any consecutive pins from one port. Best would be to use PC0-7 for example since no shifting is required. Writing to ODR would be faster but only if you dont have to mask other pins from the same port.
@easyprocesscodingacademy4884 жыл бұрын
Can u tell how to move the cursor position up, down , left, right with the coordinates value of x and y
@mutexembedded22064 жыл бұрын
Hi, There is a function to do that I believe for writing pixel
@easyprocesscodingacademy4884 жыл бұрын
@@mutexembedded2206 Hi, There is a fun called draw pixel and set cursor position. In draw pixel if I set to (0,0, colour) will it put the cursor at start and (0,1, colour) for the next row ?
@mutexembedded22064 жыл бұрын
@@easyprocesscodingacademy488 Hi, that's right, next pixel (row, col)
@mokhamadkhozin3 жыл бұрын
This is amazing tutorial! thanks!
@adnanafzal39084 жыл бұрын
i just wanted to know how to use 16 bit mode. Does the ILI9341 library work with 16bit mode
@mutexembedded22064 жыл бұрын
You need to make few changes to do that.
@adnanafzal39084 жыл бұрын
@@mutexembedded2206 can you kindly help me out with only the initialization part i am having troubles regarding it. thanks in advance
@fvgm4 жыл бұрын
hi, thanks for your tutorial about this LCD in FSMC mode! I tried step-by-step and works! But i if run it in max speed (STM32F407VET6 @ 168 Mhz) the background colors (fills, etc) show wrong. If i reduce the clock speed to, let say, 76 Mhz, everything runs fine. Can you help me ? Thanks.
@HB9GZE5 жыл бұрын
Great video thank you. I did follow your instructions and got my display working! The timing seems to be different from display board to display board; tried two TFT-Proto from MikroElektroika. Question: Have you tried a 16bit wide bus yet?
@mutexembedded22065 жыл бұрын
Hi, Yes, I think I know what you talking about, do you have the Green LCD with both 16-bits line and SPI ?
@HB9GZE5 жыл бұрын
thats the one I use: www.mikroe.com/tft-proto-board One gets me a frame rate of 14Hz and a second of the same board type only of 5Hz. I just downloaded the 16bit example from MifroElektronicas webpage. I wonder how 16bit is improving the max. framerate in my application…
@nourchenebradai50636 жыл бұрын
I HAVE A TFT LCD model HY32D so what changes to make?
@gautamkashyap68655 жыл бұрын
please upload for stm32f429i discovery board.
@raoufjmal66744 жыл бұрын
im loading the code in the board but the lcd doesn't work
@vipultyagi65906 жыл бұрын
Please make a tutorial for STM32F407 with LCD35RT
@abrahamrodriguez64626 жыл бұрын
gorgeus explanation
@meohoang77413 жыл бұрын
can u give me the library of lcd tft ili9341 16 bit?
@alouanerim98825 жыл бұрын
great tutorial how can i get the library of ili9325 and ov7670 ?? I SEARCH IN IAR website but i didn't found
@mohdrafiqrahman6 жыл бұрын
جزاك الله خير الجزاء Thanks for the detailed explanation on FSMC LCD. Hence, if I were to use a 16 bit interface, my register select should be A19 right? And could you please, please do part 4 for the ENC28J60 ethernet module and perhaps a simple tcp client on the stm32. Thanks again.
@mutexembedded22066 жыл бұрын
Rafiq Rahman That's right
@kgfathur6 жыл бұрын
thanks for your great explanation and tutorial. with the same stm32 board what configuration must be changed if using a 16-bit FSMC on ili9341?
@marekoens12965 жыл бұрын
Great video, can you please help me with adding touch here? I tried using your libraries from the other video where you work with SPI for touch but it doesn't work... I also have a display with x+,x-,y+,y- but I use a touch screen controller for that so I can work with I2C or SPI.
@mutexembedded22065 жыл бұрын
Hi, What touch controller you are using?
@marekoens12965 жыл бұрын
the STMPE610 , resistive touch screen controller
@mutexembedded22065 жыл бұрын
@@marekoens1296 Library I provided would not work with this controller. You need to write a driver for this specific chip.
@OnirMasc986 жыл бұрын
This library that you mention on the video is only for one specific TFT or I can use it for other TFT. If it only can be use for your TFT, how you create a library for TFT. Thanks
@mutexembedded22066 жыл бұрын
Hi, This can be used for any TFT with ILI9341 as LCD controller.
@mohsenmazandarani75062 жыл бұрын
Thank you for your Nice video...... Can you do something about the touch interface? it looks like it works analog too.....
@bochraakrout78405 жыл бұрын
i have the ili 9341 3.2 tft with it's arduino shield can i use the same library??
@mutexembedded22065 жыл бұрын
i believe so
@bochraakrout78405 жыл бұрын
@@mutexembedded2206 hi there thanks for your response i am trying to get it work but i just can't compile the MA_ILI9341.h the problem is on the declaration of the fount1[] the error say it has alredy declared and thanks alot for your help
@bochraakrout78405 жыл бұрын
@@mutexembedded2206 i fixed it and i downloaded the code but it doesn't work the ili9341 3.2 is a 16 bit not 8 i think that's why i am trying to find the right library
@arhamtemi28656 жыл бұрын
In the .txt file you didn't mention where to connect PD2 (from STM which you called RST) on LCD?
@mutexembedded22066 жыл бұрын
Hi Arham, right, you need to connect this to 3v in normal condition, and to GND to implement Reset.
@Ricarrr6 жыл бұрын
Many Thanks! How can I modify a the functions to work with 16bits ?
@mutexembedded22066 жыл бұрын
Hi Erisson, Sorry for the late response, you can modify the FSMC settings to use 16-bits and some little changes to the address of read/write and wiring,, all other things will remain the same.
@vnhan11686 жыл бұрын
Do you have any touchscreen, if so for me please library? thank you much
@erfanniafard56455 жыл бұрын
hello i have a stm32f3 discovery board and 3.2 tft colo lcd module v5 how can i launch this lcd because on cube mx i can't find the FSMC thank you very much in advance
@raduceban34465 жыл бұрын
I ran into the same problem, but it seems that STM32F303RE doesn't support FSMC (I guess you have the same board)
@KBera5 жыл бұрын
Sir, I followed your instructions as it is. But it is not working. It is showing a grey screen upon reset. I am using FMC of NUCLEO-H743ZI and 8bit parallel 240x320 TFT. Kindly HELP!!
@rezaahmadifar69474 жыл бұрын
hi I'm having your problem too!! i have stm32h743zi nucleo board did you find any solutions?
@sohampurkait44305 жыл бұрын
Why data address has 1 in bit 18 ? Shouldn't it be command address ?
@siminamiri33354 жыл бұрын
When i use rotation 2 and 4 mode, my sentence starts from right to left and it is mirror like. :(
@nemchen_ko3 жыл бұрын
In Display function control you have to change from ILI9341_SendData (0x82); to ILI9341_SendData (0xA2);
@civilsku16706 жыл бұрын
Hello Dear Brother I have ssd1963 7 inch lcd your library work on it? If have library for that please give me if not how make one ? Dear brother I need your help. Tanks
@mutexembedded22066 жыл бұрын
civil sku Hello, Yeah, same FSMC interface but you need the 16 bit mode for ur LCD.. I don't have a driver for this one, but you should be able to find Arduino libraries in github that you can re-use for STM. I have to say, this takes sometime, but I am sure you can manage.
@civilsku16706 жыл бұрын
Tanks For your Hoping My Bro I change your code to ssd1963 because the regeister is same you think is do right? s8.picofile.com/file/8318562492/SSD1963.c.html s9.picofile.com/file/8318562500/SSD1963.h.html
@civilsku16706 жыл бұрын
Dear Bro I found The site too that ssd1963 run with stm32f704VGT6 but i cant sign up are you can sign up and give me this code ? bro i need your help please do ever you doing chipmk.ru/index.php/10-raznoe/270-podklyuchaem-lcdssd1963-k-stm32-po-fsmc-16bit-touch tanks your helping dear Bro
@neharikamsadhwani51404 жыл бұрын
Amazing video! Thank you so much for all your work. Could you please help me understand if we can use SPI for this particular LCD instead of FSMC. I was trying to understand if I could use SPI to interface ILI9341 with STM32L4. Is SPI or FSMC better?
@caffeinatedinsanity23243 жыл бұрын
Depends. SPI uses 3-4 pins while FSMC uses over 10 pins. However FMSC can probably transfer at much higher rates since it's a parallel interface.
@rajeshn26002 жыл бұрын
@@caffeinatedinsanity2324 Can I use the same libraries if I am interfacing the same LCD through SPI ?
@m.j.49246 жыл бұрын
Hi, thanks for the reply, on the parallel interface I would argue that, in the case of an ISP connection. Does FSMC also support ISP? Is it possible to download any library for ARDUINO "TFT_22_ILI9225.h" in the STM32 environment. It is about using the least connection wires to the LCD display.
@mutexembedded22066 жыл бұрын
LMM LIGHT MY MUSIC Hi mate, Does ISP = SPI Interface ?
@m.j.49246 жыл бұрын
Hu, SPI is correct, my mistake!!
@mutexembedded22066 жыл бұрын
LMM LIGHT MY MUSIC FSMC is a different interface.. If you wanna use SPI, then you just use SPI to write to the LCD.
@EJPG35 жыл бұрын
¿que es y para qe Funciona ?.. ¿y con que conectores funciona ?...
@tebunia6 жыл бұрын
This is brilliant.
@gennadyh6 жыл бұрын
Hi , can you please make some manual with SSD1306 , and with RFID TAG? , Best regards!
@arhamtemi28656 жыл бұрын
Is there any problem if I change the clock configuration to 72 MHz instead of setting it to 168MHz? If there is any change in the code kindly let me know.
@mutexembedded22066 жыл бұрын
Hi Arham mate, It should not make a difference as long as FSMC speed is consistent.
@arhamtemi28656 жыл бұрын
Sir we are using parallel communication instead of I2C or SPI? What if we use, then which one is more efficient?
@mutexembedded22066 жыл бұрын
@@arhamtemi2865 Hi Arham, Parallel is way faster x4 times than SPI. I2C is slowest, 30 times slower than SPI. Can use SPI for less wires.
@rezaahmadifar69474 жыл бұрын
hi thank you for your tutorial I have an exact LCD and stm32h743zit6 nucleo board. i have been trying like forever to do this tutorial with my board but i cant. my lcd just blink for a few times and goes white. please please can anyone help me?
@mutexembedded22064 жыл бұрын
Hi Reza, I don't have your board around.. but I can try setting up a project that should work with yours
@mutexembedded22064 жыл бұрын
Play around with FMC clock speed in Clock Configuration CubeMX and try getting it around 168Mhz. Also disable FMC FIFO from FMC CubeMX parameters.
@rezaahmadifar69474 жыл бұрын
@@mutexembedded2206 thank you for time and answer Even with 168 MHz didn't work!!! this is my main: #include "main.h" /* Private includes ----------------------------------------------------------*/ /* USER CODE BEGIN Includes */ #include "MA_ILI9341.h" /* USER CODE END Includes */ /* Private typedef -----------------------------------------------------------*/ /* USER CODE BEGIN PTD */ /* USER CODE END PTD */ /* Private define ------------------------------------------------------------*/ /* USER CODE BEGIN PD */ /* USER CODE END PD */ /* Private macro -------------------------------------------------------------*/ /* USER CODE BEGIN PM */ /* USER CODE END PM */ /* Private variables ---------------------------------------------------------*/ SRAM_HandleTypeDef hsram1; /* USER CODE BEGIN PV */ /* USER CODE END PV */ /* Private function prototypes -----------------------------------------------*/ void SystemClock_Config(void); static void MX_GPIO_Init(void); static void MX_FMC_Init(void); /* USER CODE BEGIN PFP */ /* USER CODE END PFP */ /* Private user code ---------------------------------------------------------*/ /* USER CODE BEGIN 0 */ /* USER CODE END 0 */ /** * @brief The application entry point. * @retval int */ int main(void) { /* USER CODE BEGIN 1 */ /* USER CODE END 1 */ /* Enable I-Cache---------------------------------------------------------*/ SCB_EnableICache(); /* Enable D-Cache---------------------------------------------------------*/ SCB_EnableDCache(); /* MCU Configuration--------------------------------------------------------*/ /* Reset of all peripherals, Initializes the Flash interface and the Systick. */ HAL_Init(); /* USER CODE BEGIN Init */ /* USER CODE END Init */ /* Configure the system clock */ SystemClock_Config(); /* USER CODE BEGIN SysInit */ /* USER CODE END SysInit */ /* Initialize all configured peripherals */ MX_GPIO_Init(); MX_FMC_Init(); /* USER CODE BEGIN 2 */ HAL_Delay(1000); HAL_GPIO_WritePin(GPIOA, GPIO_PIN_3, GPIO_PIN_RESET); HAL_Delay(10); HAL_GPIO_WritePin(GPIOA, GPIO_PIN_3, GPIO_PIN_SET); ILI9341_Init(); HAL_Delay(1000); ILI9341_setRotation(3); ILI9341_Fill(COLOR_BLUE); //Draw and fill circle ILI9341_drawCircle(50,50, 40, COLOR_GREEN); ILI9341_fillCircle(110,190, 80, COLOR_RED); //Print text ILI9341_printText("HELLO", 60, 90, COLOR_YELLOW, COLOR_YELLOW, 5); //Print-Fill triangle ILI9341_fillTriangle(10, 160, 110, 160, 190, 300, COLOR_BLACK); HAL_Delay(1000); // ILI9341_printImage(50, 50, 80, 130, myImage, sizeof(myImage)); /* USER CODE END 2 */ /* Infinite loop */ /* USER CODE BEGIN WHILE */ while (1) { /* USER CODE END WHILE */ /* USER CODE BEGIN 3 */ } /* USER CODE END 3 */ } /** * @brief System Clock Configuration * @retval None */ void SystemClock_Config(void) { RCC_OscInitTypeDef RCC_OscInitStruct = {0}; RCC_ClkInitTypeDef RCC_ClkInitStruct = {0}; RCC_PeriphCLKInitTypeDef PeriphClkInitStruct = {0}; /** Supply configuration update enable */ HAL_PWREx_ConfigSupply(PWR_LDO_SUPPLY); /** Configure the main internal regulator output voltage */ __HAL_PWR_VOLTAGESCALING_CONFIG(PWR_REGULATOR_VOLTAGE_SCALE0); while(!__HAL_PWR_GET_FLAG(PWR_FLAG_VOSRDY)) {} /** Initializes the CPU, AHB and APB busses clocks */ RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSE; RCC_OscInitStruct.HSEState = RCC_HSE_BYPASS; RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON; RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSE; RCC_OscInitStruct.PLL.PLLM = 1; RCC_OscInitStruct.PLL.PLLN = 42; RCC_OscInitStruct.PLL.PLLP = 2; RCC_OscInitStruct.PLL.PLLQ = 16; RCC_OscInitStruct.PLL.PLLR = 2; RCC_OscInitStruct.PLL.PLLRGE = RCC_PLL1VCIRANGE_3; RCC_OscInitStruct.PLL.PLLVCOSEL = RCC_PLL1VCOWIDE; RCC_OscInitStruct.PLL.PLLFRACN = 0; if (HAL_RCC_OscConfig(&RCC_OscInitStruct) != HAL_OK) { Error_Handler(); } /** Initializes the CPU, AHB and APB busses clocks */ RCC_ClkInitStruct.ClockType = RCC_CLOCKTYPE_HCLK|RCC_CLOCKTYPE_SYSCLK |RCC_CLOCKTYPE_PCLK1|RCC_CLOCKTYPE_PCLK2 |RCC_CLOCKTYPE_D3PCLK1|RCC_CLOCKTYPE_D1PCLK1; RCC_ClkInitStruct.SYSCLKSource = RCC_SYSCLKSOURCE_PLLCLK; RCC_ClkInitStruct.SYSCLKDivider = RCC_SYSCLK_DIV1; RCC_ClkInitStruct.AHBCLKDivider = RCC_HCLK_DIV1; RCC_ClkInitStruct.APB3CLKDivider = RCC_APB3_DIV2; RCC_ClkInitStruct.APB1CLKDivider = RCC_APB1_DIV2; RCC_ClkInitStruct.APB2CLKDivider = RCC_APB2_DIV2; RCC_ClkInitStruct.APB4CLKDivider = RCC_APB4_DIV2; if (HAL_RCC_ClockConfig(&RCC_ClkInitStruct, FLASH_LATENCY_2) != HAL_OK) { Error_Handler(); } PeriphClkInitStruct.PeriphClockSelection = RCC_PERIPHCLK_FMC; PeriphClkInitStruct.FmcClockSelection = RCC_FMCCLKSOURCE_D1HCLK; if (HAL_RCCEx_PeriphCLKConfig(&PeriphClkInitStruct) != HAL_OK) { Error_Handler(); } } /* FMC initialization function */ static void MX_FMC_Init(void) { /* USER CODE BEGIN FMC_Init 0 */ /* USER CODE END FMC_Init 0 */ FMC_NORSRAM_TimingTypeDef Timing = {0}; /* USER CODE BEGIN FMC_Init 1 */ /* USER CODE END FMC_Init 1 */ /** Perform the SRAM1 memory initialization sequence */ hsram1.Instance = FMC_NORSRAM_DEVICE; hsram1.Extended = FMC_NORSRAM_EXTENDED_DEVICE; /* hsram1.Init */ hsram1.Init.NSBank = FMC_NORSRAM_BANK1; hsram1.Init.DataAddressMux = FMC_DATA_ADDRESS_MUX_DISABLE; hsram1.Init.MemoryType = FMC_MEMORY_TYPE_SRAM; hsram1.Init.MemoryDataWidth = FMC_NORSRAM_MEM_BUS_WIDTH_8; hsram1.Init.BurstAccessMode = FMC_BURST_ACCESS_MODE_DISABLE; hsram1.Init.WaitSignalPolarity = FMC_WAIT_SIGNAL_POLARITY_LOW; hsram1.Init.WaitSignalActive = FMC_WAIT_TIMING_BEFORE_WS; hsram1.Init.WriteOperation = FMC_WRITE_OPERATION_ENABLE; hsram1.Init.WaitSignal = FMC_WAIT_SIGNAL_DISABLE; hsram1.Init.ExtendedMode = FMC_EXTENDED_MODE_DISABLE; hsram1.Init.AsynchronousWait = FMC_ASYNCHRONOUS_WAIT_DISABLE; hsram1.Init.WriteBurst = FMC_WRITE_BURST_DISABLE; hsram1.Init.ContinuousClock = FMC_CONTINUOUS_CLOCK_SYNC_ONLY; hsram1.Init.WriteFifo = FMC_WRITE_FIFO_DISABLE; hsram1.Init.PageSize = FMC_PAGE_SIZE_NONE; /* Timing */ Timing.AddressSetupTime = 6; Timing.AddressHoldTime = 0; Timing.DataSetupTime = 6; Timing.BusTurnAroundDuration = 0; Timing.CLKDivision = 0; Timing.DataLatency = 0; Timing.AccessMode = FMC_ACCESS_MODE_A; /* ExtTiming */ if (HAL_SRAM_Init(&hsram1, &Timing, NULL) != HAL_OK) { Error_Handler( ); } /* USER CODE BEGIN FMC_Init 2 */ /* USER CODE END FMC_Init 2 */ } /** * @brief GPIO Initialization Function * @param None * @retval None */ static void MX_GPIO_Init(void) { GPIO_InitTypeDef GPIO_InitStruct = {0}; /* GPIO Ports Clock Enable */ __HAL_RCC_GPIOC_CLK_ENABLE(); __HAL_RCC_GPIOH_CLK_ENABLE(); __HAL_RCC_GPIOA_CLK_ENABLE(); __HAL_RCC_GPIOE_CLK_ENABLE(); __HAL_RCC_GPIOB_CLK_ENABLE(); __HAL_RCC_GPIOD_CLK_ENABLE(); __HAL_RCC_GPIOG_CLK_ENABLE(); /*Configure GPIO pin Output Level */ HAL_GPIO_WritePin(GPIOA, GPIO_PIN_3, GPIO_PIN_RESET); /*Configure GPIO pin Output Level */ HAL_GPIO_WritePin(GPIOB, GPIO_PIN_14|GPIO_PIN_7, GPIO_PIN_RESET); /*Configure GPIO pin Output Level */ HAL_GPIO_WritePin(GPIOG, GPIO_PIN_6, GPIO_PIN_RESET); /*Configure GPIO pin : PC13 */ GPIO_InitStruct.Pin = GPIO_PIN_13; GPIO_InitStruct.Mode = GPIO_MODE_IT_RISING; GPIO_InitStruct.Pull = GPIO_NOPULL; HAL_GPIO_Init(GPIOC, &GPIO_InitStruct); /*Configure GPIO pin : PA3 */ GPIO_InitStruct.Pin = GPIO_PIN_3; GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP; GPIO_InitStruct.Pull = GPIO_NOPULL; GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW; HAL_GPIO_Init(GPIOA, &GPIO_InitStruct); /*Configure GPIO pins : PB14 PB7 */ GPIO_InitStruct.Pin = GPIO_PIN_14|GPIO_PIN_7; GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP; GPIO_InitStruct.Pull = GPIO_NOPULL; GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW; HAL_GPIO_Init(GPIOB, &GPIO_InitStruct); /*Configure GPIO pin : PG6 */ GPIO_InitStruct.Pin = GPIO_PIN_6; GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP; GPIO_InitStruct.Pull = GPIO_NOPULL; GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW; HAL_GPIO_Init(GPIOG, &GPIO_InitStruct); /*Configure GPIO pin : PG7 */ GPIO_InitStruct.Pin = GPIO_PIN_7; GPIO_InitStruct.Mode = GPIO_MODE_INPUT; GPIO_InitStruct.Pull = GPIO_NOPULL; HAL_GPIO_Init(GPIOG, &GPIO_InitStruct); } /* USER CODE BEGIN 4 */ /* USER CODE END 4 */ /** * @brief This function is executed in case of error occurrence. * @retval None */ void Error_Handler(void) { /* USER CODE BEGIN Error_Handler_Debug */ /* User can add his own implementation to report the HAL error return state */ /* USER CODE END Error_Handler_Debug */ } #ifdef USE_FULL_ASSERT /** * @brief Reports the name of the source file and the source line number * where the assert_param error has occurred. * @param file: pointer to the source file name * @param line: assert_param error line source number * @retval None */ void assert_failed(uint8_t *file, uint32_t line) { /* USER CODE BEGIN 6 */ /* User can add his own implementation to report the file name and line number, tex: printf("Wrong parameters value: file %s on line %d ", file, line) */ /* USER CODE END 6 */ } #endif /* USE_FULL_ASSERT */ /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
@rezaahmadifar69474 жыл бұрын
@@mutexembedded2206 Can i send my project to you please? can i have your email or something else?
@omro19856 жыл бұрын
ممتاز . بالتوفيق
@andrezsa235 жыл бұрын
Hello very good videos I have an lcd 3.2inches with ILI9341 and interfaces of 16bit LCD register select is A18 modify *(__IO uint16_t *)(0x60080000) data; and it works I see the color blue, but I can't change the colors when I write text or a figure the color is wrong I wanted to ask you that something else I have to modify so that the colors are displayed correctly with 16bit interfas thank you very much
@hooligun904 жыл бұрын
Hello, I have the same problem. Did you find a sollution for it?
@psyduckel6 жыл бұрын
Hi there MYaqoobEmbedded, Would the tutorial work using the NUCLEO-L476RG, if not what would you need to change? Thanks for any help.
@mutexembedded22066 жыл бұрын
Hi, No, the L476 does not seem to have an FSMC NOR interface.
@psyduckel6 жыл бұрын
Do you have any recommendations on how to get an TFT LCD ILI9341 screen working on the NUCLEO-L476RG?
@mutexembedded22066 жыл бұрын
Psyduck Hi, You can replace FSMC Read/Write functions with SPI read/write .. but needs to set your display to spi mode.
@psyduckel6 жыл бұрын
MYaqoobEmbedded thanks for the reply, unfortunately the screen I'm using does have spi :'(
@mutexembedded22066 жыл бұрын
Psyduck You can try implementing the parallel interface timing yourself; Set the data on 8bits or 16 bits pins and trigger WR pin to write data to lcd.. There are a lot more details about this on lcd data sheet.. Just google lcd parallel interface 8080
@wuerike6 жыл бұрын
Great video! I have a stm32L4 and it havent the FSMC option, could you teach how to do it by the SPI interface?
@mutexembedded22066 жыл бұрын
Hi, Modify Read/Write functions to use SPI Write&Read instead of FSMC Read/Write,, as simple as that.
@mrudulaamirapu24726 жыл бұрын
Yes, I too would like to know how to do the same. If you can, please give a little more information. Thanks!
@mutexembedded22066 жыл бұрын
Mrudula Amirapu Hi, Sure.. I will explain to you how to do that with some coding later today.
@mrudulaamirapu24726 жыл бұрын
Thank you very much! I find your tutorials very helpful! :)
@mutexembedded22066 жыл бұрын
There are 4 changes you need to make to replace FSMC with SPI: Step(1): The wiring of LCD SPI interface is different MBED Display + 3,3V 3,3V GND GND MOSI SDI MISO SDO SCK RS CS CS Reset RST DC WR/SCL GND RD Step(2): Need to enable a Digital Output pin DC pin (Data/Command) - At the start of ILI9341_SendCommand() function, set DC to LOW. - At ILI9341_SendData() function, set DC to HIGH. Step(3): replace "*(__IO uint8_t *)(0x60000000) = com;" in ILI9341_SendCommand() function with HAL_SPI_Transmit() function and transmit the command byte. Step(4): Similarly replace "*(__IO uint8_t *)(0x60040000) = data;" in ILI9341_SendData() function with HAL_SPI_Transmit() function and transmit the data byte. So, the modified functions should look something like this: ILI9341_SendCommand(uint8_t com) { HAL_GPIO_WritePin(DC_Port, DC_Pin, 0); HAL_SPI_Transmit(&hspi, com, 1, Timeout); } ILI9341_SendData(uint8_t data) { HAL_GPIO_WritePin(DC_Port, DC_Pin, 1); HAL_SPI_Transmit(&hspi, data 1, Timeout); } That's pretty much it,, Good luck
@bobchen49246 жыл бұрын
Thank you very mouch!!!
@bobchen49246 жыл бұрын
May I know which pin is "RST" ?
@mutexembedded22066 жыл бұрын
Hi Bob, Good spot, just need to connect it to VCC to enable the LCD.
@hoangphamtranminh83446 жыл бұрын
This is what i need. But i think you should have a video clip to demo. But it’s still a nice vid. Tks
@shamssalehin237610 ай бұрын
Please do same for SSD1963
@hoangphamtranminh83446 жыл бұрын
Is it a possible to touch on screen? Because i see you only display the pic on screen. Hope you answer my question. I need to know because i’m ready to buy that screen. Tks
@mutexembedded22066 жыл бұрын
Hi, Yes, this one has got resistive touch, but touch pins (x+, x-, y+, y-) are shared with communication pins, look that up. There is a good alternative too, that works with this library: www.mikroe.com/tft-proto-board Good luck
@hoangphamtranminh83446 жыл бұрын
Tks for your quink reply but I still have some question. You said that touch pins are shared with communication pins. So you mean that is impossible to do touch action on that screen with stm32f4, isn't it? Hope you rep soon because i'm ready to buy that touch screen (in you vid) to use for kit stm32f4 :D
@mutexembedded22066 жыл бұрын
Hi mate, What I meant by touch pins are shared at this particular module is that, X+, X-, Y+, Y- are connected directly to LCD_WR, LCD_RD, and so on. So in order to take Touch reading, you need to stop communicating to the LCD temporarily and convert LCD_WR pin from Output to Input in order to read touch value. But there are better ili9341 screen boards where touch pins are separate.
@edwardsoto32794 жыл бұрын
you will obtain a better performance using the HAL FMC library
@kinsi554 жыл бұрын
Thanks a lot.
@nicknagy89034 жыл бұрын
I'm using this with an STM32F767ZI and getting weird results. It looks as if the functions and examples are ALMOST working. For example, printImage(50, 50, 80, 130, myImage, sizeof(myImage)) creates an image that's way too thin, in the bottom corner, and looks discolored. Or Fill(COLOR_RED) will create some red pixels at the edge but not cover the screen. I've disabled the FMC FIFO, the FMC clock SHOULD be at 168MHz, I'm using single jumper wires between each connection to try and minimize signal travels, and I've checked the connections multiple times. I have also tested in Arduino with at ATMega and a different class-distributed library for the TFT, and have verified that with that code the TFT works fine. So I know that the problem must have to do with the STM32/Nucleo, not the TFT itself. I can't figure out what I am doing incorrectly. I'm using TrueSTUDIO instead of Keil, would that make a difference??
@yordaniferreiras69954 жыл бұрын
I have your same Development Board and it works perfectly with what he did in this tutorial.
@nicknagy89034 жыл бұрын
@@yordaniferreiras6995 All is well! I figured out the issue, I had to enable memory-swapping and replace the 0x6x.. addresses with 0xCx...
@m-aliamouzgar41386 жыл бұрын
perfect
@adnanafzal39084 жыл бұрын
please make a video on dcmi as well
@raoufjmal66744 жыл бұрын
I use Atollic True Studio and i have a problem in the path MA_ILI9341.h
@mutexembedded22064 жыл бұрын
What sort of Path problem? Or actually a compiling error?
@raoufjmal66744 жыл бұрын
@@mutexembedded2206 a compiling error, i think that because i don't know the place of MA_ILI9341.h when added
@mutexembedded22064 жыл бұрын
@@raoufjmal6674 easiest way is to add MA_ILI9341.h in inc folder and .c in src folder.
@raoufjmal66744 жыл бұрын
@@mutexembedded2206 i do these but doesn't work
@mutexembedded22064 жыл бұрын
@@raoufjmal6674 What is the error Msg
@mahmoudelghzaly49185 жыл бұрын
لو سمحت ممكن تفاصيل اكتر عن ال FSMC انا شغال بشاشه تانيه رقمها ili9486 لما دورت لقيت انها هي هياها ال ili9341 و راجعت علي ال commands و قارنتها بينهم في الداتا شيت كانوا زي بعض بس في نفس الوقت مش بتعرض علي الشاشه غير لما غيرت ال frequance و العرض كان في نص الشاشة ف هل في امكانيه لو يكون في شرح مفضل اكتر عن FSMC لو ممكن اتواصل مع حضرتك عشان احل المشكلة ؟ و شكرا جدا لمجهود حضرتك
@mutexembedded22065 жыл бұрын
مرحبا محمد Showing content on half of the screen only is usually caused by data bus width; if you are using 8 data lines and LCD is set to use 16 data lines mode, it will only fill half of the screen. Thanks
@mahmoudelghzaly49185 жыл бұрын
@@mutexembedded2206 شكرا لردك :D بس اظن المشكله مش في ال data bus width هي الشاشه مش النص بالظبط يعني و النص التاني بيظهر فيه خطوط عشوائيه غير انا انا مستخدم shield جاهز و متصمم علي 8 bit زي اللي حضرتك مستخدمه لما فتحت الداتا شيت لقت ان في اكتر من مود تمام اقدر استخمه 8-16 bit بس عشان اعدم هيبقي من خلال IM pins و هما مش ظاهرين علي البورده دي الشاشه للي بستخدمها ram-e-shop.com/product/kit-lcd-tft3-2-touch/
@mahmoudelghzaly49185 жыл бұрын
Hi again i have found the problem it was in the initialization function under display section i have changer the value of " ILI9341_SendData (0x27)" to " ILI9341_SendData (0x3b)" and it worked fine ::D but now i need to change the refresh rate of the lcd ... any idea ?
@mutexembedded22065 жыл бұрын
@@mahmoudelghzaly4918 Good job Mahmoud! Do you mean how fast display controller scan across LCD or how fast STM updates data to LCD ?
@mahmoudelghzaly49185 жыл бұрын
@@mutexembedded2206 i think how fast display controller scan across LCD the lcd blinking can be noticed
@xilinx805 жыл бұрын
Thank you
@sandrok146 жыл бұрын
I subscribed to your awesome channel and like every video! You helped a lot in these playlist series. Can you make a video about 1.8 TFT ST7735 display but without any shields. It has only DIN and CLK pins for data and several pins for control. Thanks in advance
@mutexembedded22066 жыл бұрын
Amfibrachy Hello! Good to hear that you're finding the videos helpful.. For the ST7735 LCD, it should not be too hard to look at an existing code alongside with its datasheet to create a driver for it. I have not worked on this before, but you should be fine if you spent sometime on it. Good luck
@sandrok146 жыл бұрын
Thanks you. That's my laziness I suppose )) I haven't watched all your videos yet. So do you think if i'll follow all of them, I'll be able to make the display work without any library, all on my own + CubeMX?
@arhamtemi28656 жыл бұрын
Sir can I get your mail? I have something to discuss with you.
@mutexembedded22066 жыл бұрын
That's fine, can do. But if it is related to the video above, would certainly help others to raise it here.
@rezaghayoumianaraki20355 жыл бұрын
good
@sonnguyen69924 жыл бұрын
Hello guide, I use FSMC for LCD TFT 5'' SSD1963 mode 16 bit. But It has a error. This is a image when run function Init drive.google.com/file/d/17jd5oKFFLMNyya8cKo2-zeFUZq4R164u/view?usp=sharing
@designworks73476 жыл бұрын
Sdcard plz
@mutexembedded22066 жыл бұрын
I thought I already have one
@usrrsr6 жыл бұрын
The Code is well explained however it will be further useful if you create video of .. A ILI9341 2.4 keil Project configured with cubemx , gui created with GUIBuilder, and touch screen code To add further you can really demostrate the use of gui development tool like "μGUI - free Open Source GUI module for embedded systems" [embeddedlightning.com/ugui/] EasyGUI - Easy GUI for microcontrollers [github.com/MaJerle/EasyGUI] littlev - [littlevgl.com/porting] Since these three tools are free of cost and really contributes a main step of product development thanks