Welcome to STM32F103RCT6 Core board repository
2.Drive LCD
Drive LCD
Drive LCD1. LCD Introduction2.Principle of LCD drive3.Simple analysis of LCD driver code4.Experimental effect
1. LCD Introduction
The working voltage of the LCD on the board is 3.3V, only 0.96 inches, and the resolution is 80 * 160. The driver chip used is ST7735S, which can be controlled by SPI communication. It is a TFT color screen with any color. It also has a better feature, which is a plug-in connection mode. When the LCD screen is damaged, it can be directly replaced with a new one.
2.Principle of LCD drive
According to the LCD manual in the schematic diagram and hardware data.

conclusion:
- The SPI communication mode is used, and the SPI communication mode of software is used in this experiment
- The register should be initialized and configured according to the ST7735S chip manual
3.Simple analysis of LCD driver code
xint main(void){ u8 i; BSP_init(); LCD_Fill(0,0,LCD_W,LCD_H,WHITE); LCD_ShowPicture(20,45,120,29,gImage_pic1); LCD_ShowString(10,0,"Hello World!",BLACK,WHITE,16,0); LCD_ShowChinese(50,20,"亚博智能",BLUE,WHITE,16,0); while(1) { if(Key1_State(0)) LED =!LED; i++;if(i>=color_max) i =red; RGB_control(i); delay_ms(3000); }}BSP_init():Initialize the RGB, LCD, KEY and LED on board, and the LCD inside_ Init() function This is LCD initialization
- LCD_Init():The first step is to initialize the SPI communication mode of the software, and then the second step is to initialize the registers in the LCD screen. When the initialization is successful, the LCD can display the bottom screen of any color. This routine is white.
- LCD_Fill():A function that displays the bottom screen of any color.
- LCD_ShowPicture():A picture is displayed, but the picture must first be converted into an array and saved in the program using the mold tool.
- LCD_ShowString():A string of English characters is displayed.
- LCD_ShowChinese():Chinese characters are displayed, but Chinese characters can only be displayed after they are converted into an array and saved in the program with the mold tool. Please learn the use of the mold tool by yourself in Baidu or in the hardware data
4.Experimental effect
- The seven colors of RGB will be changed at intervals
- The blue LED on the board is off. When the key 1 on the board is pressed, the blue LED will flash continuously.
- The LCD screen will display the effect as shown in the figure
