cancel
Showing results for 
Search instead for 
Did you mean: 

STM32 to LCD(8-bit CMSIS) help

HectorV
Associate II

Hi all,

I need help. I am using the STM32-F446RE Nucleo-board and I have it connected to a 1602A LCD display. I am trying to write "Embedded" on the first row and "Systems" on the second row, but I get it all in row 1. Can someone look over my code and let me know what I am doing wrong? I have attached pictures of my physical connections and code. Thank you.

LCD Picture.jpg

2 REPLIES 2
JTP1
Lead

Hello

It is possible that your delay is optimized away since it is empty loop. Try put some code to loop

https://stackoverflow.com/questions/70907142/delay-implementation-in-stm32-using-for-loop

Or maybe call HAL_delay inside your delay- function.

Br J.T

Leo.94
Associate II

Hello
It’s possible it’s the delay.
Try changing your code:
void lcdInitialize(void)
{

lcdCommand(0x38); // Configuring lcd in 16column and 2row format
delayMs(5);
lcdCommand(0x38); // Configuring lcd in 16column and 2row format
delayMs(3);
lcdCommand(0x0C); // Display on, cursor off
delayMs(3);
lcdCommand(0x06); // Increment cursor
delayMs(3);
lcdCommand(0x01); // Clear screen
delayMs(3);
}