Introduction: To Display “YOUR NAME” on 16x2 LCD Without I2C Module Using HAL Programming.

" Welcome to a place where everything fits together perfectly and is carefully engineered. Every tiny dot on the screen has a story to tell and every line of computer instructions brings our hardware to life. " Today, we start learning about how to connect a STM32 Black Pill with STM32CubeIDE to control LCD's. It will help us become experts in this area. 

In this detailed guide, we explore how to display your name on LCD using STM32 Black Pill microcontroller in HAL Programming, explaining everything in a clear and easy-to-understand way.  Whether you are an experienced developer looking to learn new things or just someone interested in learning about embedded systems, this blog is designed to help and motivate you. 

We use STM32CubeIDE to help us work creatively and professionally with hardware and software. Together, we'll use this special computer setup to create beautiful stories from data. 

Get ready to discover all the amazing things your STM32 Black Pill can do as we learn and explore together. Let's go beyond limits, combine new ideas with old ones, and create new ways to control displays. The canvas is empty, we have all the tools we need; it's time to create something amazing that connects and works well. 

Come with us as we start this journey of discovering new things. Together, we will figure out how embedded systems work and understand what is going on inside them. Welcome to a place where creativity meets smart ideas, where every computer code creates the future, and where the adventure itself is just as exciting as reaching the goal. 

Supplies

  1. STM32 Black Pill
  2. LCD with I2C
  3. Female to Female Jumpers
  4. STMCubeIDE
  5. STMCubeProgrammer
  6. USB C Cable

Step 1: Downloading

You will need a black pill board and STM cube IDE for this project. If you don't have the IDE yet, you can get it from the STMicroelectronics website. After you install the IDE, you will need to set up your project.

Step 2: Creating New Project

In the cube IDE program, go to "File" and then choose "New Project. " Pick "STM32F401CCU6" from the list and click "Next. "

Step 3: Downloading Library

Step 4: Pin Configuration

Select Pin B6 and B7 for SCL and SDA respectively

Step 5: I2C Configuration

Configure the I2C mode to I2C under Connections Menu

Step 6: Configuring the Clock

Step 7: 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("KHUSHPREET");

HD44780_SetCursor(0,1);

HD44780_PrintStr("KAUR");

HAL_Delay(2000);

}

Step 8: Creating Hex File

Click on file>properties>hex file and create a hex file

Step 9: Implementation of Hex File

Open hex file in cube programmer and execute it using STM 32

Step 10: Congrats!