yahboom
HomeLearn
Solution
Blog
Online Store
About Us
EN/中文
STM32F103RCT6 Core board📖
Basic introduction of core board
  • Basic introduction
Experimental documents
  • 1.Turn on RGB light
  • 2.Drive LCD
  • 3.Detect external Flash
  • 4.Read IMU raw data
  • 5. Key control
  • 6. External interruption experiment
  • 7. ADC acquisition
  • 8. PWM Breathing Lamp Experiment
  • 9. Serial communication
Download
  • Source code
  • Environment building tools
  • Hardware data
Download ZIP

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. image-2023022700001

conclusion:

  1. The SPI communication mode is used, and the SPI communication mode of software is used in this experiment
  2. The register should be initialized and configured according to the ST7735S chip manual

3.Simple analysis of LCD driver code

​x
int main(void)
{   
    u8 i;
    BSP_init();
    
    #if LCD_SWITCH
        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);  
    #endif
    
    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

  1. The seven colors of RGB will be changed at intervals
  2. The blue LED on the board is off. When the key 1 on the board is pressed, the blue LED will flash continuously.
  3. The LCD screen will display the effect as shown in the figure image-2023022700002
Turn on RGB light
Detect external Flash

COMPANY

  • About us
  • Team Style
  • Blog

LEARNING & EXPLORATION

  • Tutorials
  • Edge AI hardware
  • Educational robots
  • Embedded intelligent hardware

WHERE TO BUY

  • Yahboom Online Store
  • Amazon
  • Alibaba
  • AliExpress
  • Mercado

TECHNOLOGY SUPPORT

  • Email: support@yahboom.com

BE A DISTRIBUTOR

  • Email: sales@yahboom.com
QR Code

Copyright © 2017-2026 Yahboom. All Rights Reserved.

EN/中文