Position: Index > Unclassified >

Driving Graphical LCD with STM32F103ZET6

2017-11-24 01:29  
Declaration:We aim to transmit more information by carrying articles . We will delete it soon, if we are involved in the problems of article content ,copyright or other problems.

STM32F103ZET6 board comes with 3.2 inch graphical LCD which features an ILI9320 controller. Equipped LCD is capable of displaying 252144 colors when driven in 18-bit mode. We are gonna drive it in 16-bit mode, so we are limiting it to 65K colors.

LCD driver is based on existing code found on internet which was originally developed for STM3210E board. Only minor modifications were needed like assigning right control pins.

STM32F103ZET6 board was designed so that LCD was connected to Flexible Static Memory Controller (FSMC) of STM32. FSCM allows connecting most of external parallel memory types like ROM, SRAM, NOR Flash, NAND Flash. ILI9320 driven LCD is connected in 16-bit mode to FSMC Bank1 4thsubpage and is seen as SRAM memory, so once configured controlling LCD becomes same as writing to SRAM. LCD memory starts from address 0x6C000000

#define LCD_BASE ((u32)(0x60000000 | 0x0C000000))

#define LCD ((LCD_TypeDef *) LCD_BASE)

LCD is controlled by using index register which points to selected register and with next operation we can write to its memory. So for this there is a simple structure used:

 

what allows writing to register with simple routine:

voidLCD_WriteReg(u8 LCD_Reg, u16 LCD_RegValue)

{

//Write 16-bit Index, then Write Reg

LCD->LCD_REG = LCD_Reg;

LCD->LCD_RAM = LCD_RegValue;

}

There are 152 registers used to control LCD and most of these has to be initialized before accessing LCD. As I mentioned it is already done in LCD library no need to wary for now. In attached project you’ll find a working example of LCD which simply displays a bitmap image stored in MCU SRAM.

By pressing one of four buttons you can cycle through other functions like drawing simple shapes, displaying text and drawing sine wave. Hopefully you’ll find this useful.?STM32F103ZET6GLCD


Reprinted Url Of This Article:
http://www.scienceprog.com/driving-graphical-lcd-with-stm32f103zet6/