To Start With STM32 Black Pill and STM Cube IDE to Display “YOUR NAME” on 16x2 LCD Without I2C Module Using HAL Programming.
by taniya_4561 in Circuits > Microcontrollers
123 Views, 1 Favorites, 0 Comments
To Start With STM32 Black Pill and STM Cube IDE to Display “YOUR NAME” on 16x2 LCD Without I2C Module Using HAL Programming.
The STM32 Black Pill, a popular STM32 development board, offers a cost-effective and versatile platform for embedded systems development. Coupled with STM32CubeIDE, an integrated development environment (IDE) from STMicroelectronics, developers can harness the power of Hardware Abstraction Layer (HAL) programming to efficiently utilize the STM32 microcontroller's capabilities.
In this guide, we'll explore how to display "YOUR NAME" on a 16x2 LCD without an I2C module using HAL programming with the STM32 Black Pill and STM32CubeIDE. This tutorial serves as a primer for beginners looking to embark on embedded development with STM32 microcontrollers.
Supplies
- STM32 Black Pill
- LCD with I2C
- Female to Female Jumpers
- STMCubeIDE
- STMCubeProgrammer
- USB C Cable
Step 1: Downloading
The LiquidCrystal library simplifies the process of interfacing with character LCD displays, making it accessible for hobbyists and professionals alike. By providing an easy-to-use interface and abstracting away hardware complexities, it enables developers to focus on building creative projects without getting bogged down in low-level details. Whether you're displaying sensor data, creating custom interfaces, or adding visual feedback to your projects, the LiquidCrystal library is a valuable tool in the Arduino ecosystem.
Download the file from- https://github.com/eziya/STM32_HAL_I2C_HD44780/blob/master/Src/liquidcrystal_i2c.h
or you can download it from any search engine you like.
Step 6: Adding the Code
#include "main.h"
#include "liquidcrystal_i2c.h"
I2C_HandleTypeDef hi2c1;
void SystemClock_Config(void);
static void MX_GPIO_Init(void);
static void MX_I2C1_Init(void);
int main(void)
{
HAL_Init();
SystemClock_Config();
MX_GPIO_Init();
MX_I2C1_Init();
HD44780_Init(2);
HD44780_Clear();
HD44780_SetCursor(0,0);
HD44780_PrintStr("taniya");
HD44780_SetCursor(0,1);
HD44780_PrintStr("sharma");
HAL_Delay(2000);
}