2023-08-21 03:27 PM
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.
2023-08-21 05:46 PM - edited 2023-08-21 05:47 PM
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
2023-08-21 06:31 PM
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);
}