Display “Chitkara University” on 16x2 LCD Without I2C Module Using HAL Programming

by amateurwriter in Circuits > Microcontrollers

156 Views, 0 Favorites, 0 Comments

Display “Chitkara University” on 16x2 LCD Without I2C Module Using HAL Programming

images (3).jpg

In this blog, we will explore how to display "Chitkara University" on a 16x2 LCD using the STM32 black pill board and STM Cube IDE. We will achieve this without using an I2C module, but rather through HAL programming.

Supplies

Screen-Shot-2019-12-28-at-11.20.31-AM.png

List of components used:

STM32 Black Pill Board:

The STM32 black pill board is a small but powerful microcontroller board that is built around the STM32F103C8T6 microcontroller. It is based on the ARM Cortex-M3 processor, which provides high performance and low power consumption. The board has a range of features including 64 KB of flash memory, 20 KB of SRAM, and multiple communication interfaces such as USART, SPI, and I2C.

16x2 LCD Display:

The 16x2 LCD display is a popular display module that is commonly used in various embedded systems. It has 16 columns and 2 rows of characters that can be displayed. Each character is made up of 5x8 pixels, and the display can be controlled through a parallel interface.

STM Cube IDE:

STM Cube IDE is a development environment for STM32 microcontrollers. It provides a graphical user interface (GUI) for creating and editing projects, writing and debugging code, and configuring peripherals. The IDE is based on the Eclipse platform and provides a range of features such as code autocompletion, debugging tools, and code profiling.

HAL Programming:

HAL programming is a high-level abstraction layer that simplifies the programming process for STM32 microcontrollers. It provides a set of APIs that allow developers to control the microcontroller's peripherals without needing to know the low-level details of the hardware. The HAL APIs are part of the STM32Cube firmware package and can be used with STM Cube IDE.

Setting Up the Hardware

pp.png
download (6).png

Connect the STM32 black pill board to the breadboard using jumper wires. Connect the USB to UART converter to the board using the following connections:

  • STM32 black pill board GND to USB to UART converter GND
  • STM32 black pill board 5V to USB to UART converter 5V
  • STM32 black pill board PA2 to USB to UART converter TX
  • STM32 black pill board PA3 to USB to UART converter RX

Connect the LCD display to the breadboard using jumper wires. Connect the display to the board using the following connections:

  • LCD display GND to STM32 black pill board GND
  • LCD display VCC to STM32 black pill board 5V
  • LCD display RS to STM32 black pill board PB12
  • LCD display RW to STM32 black pill board GND
  • LCD display EN to STM32 black pill board PB13
  • LCD display D4 to STM32 black pill board PB14
  • LCD display D5 to STM32 black pill board PB15
  • LCD display D6 to STM32 black pill board PC6
  • LCD display D7 to STM32 black pill board PC7


Creating a New Project in STM Cube IDE

pp.png

Open STM Cube IDE and create a new project by selecting File > New > STM32 Project. Choose your board and click Next. Select a template for your project and click Next. Choose your toolchain and click Finish.

Configuring the Peripherals

download (6).png
pp.png

In the Project Manager window, expand the project folder and open the Configuration Wizard. Select the Clock Configuration tab and configure the clock settings for your project. Select the LCD Display tab and configure the LCD settings as follows:

  • Select "Use default





Write Code

Screenshot (381).png

Write code given above in the STM 32 Cube IDE