Skip to main content
ATavo.1
Associate III
May 7, 2022
Question

The LCD is working but not showing any character?

  • May 7, 2022
  • 6 replies
  • 4116 views

Hi,

I am using stm32f103 and IAR for codes.

I am trying to use a character LCD 16x2 for my project. It turns on with 5 volt that I connect but not showing any character. I changed the potentiometer and still no sign of characters.

I was wondering what the problem is?

Here is the main code

int main(void)
{
 /* USER CODE BEGIN 1 */
 
 /* USER CODE END 1 */
 
 /* MCU Configuration--------------------------------------------------------*/
 
 /* Reset of all peripherals, Initializes the Flash interface and the Systick. */
 HAL_Init();
 
 /* USER CODE BEGIN Init */
 lcd_init();
 /* USER CODE END Init */
 
 /* Configure the system clock */
 SystemClock_Config();
 
 /* USER CODE BEGIN SysInit */
 
 /* USER CODE END SysInit */
 
 /* Initialize all configured peripherals */
 MX_GPIO_Init();
 /* USER CODE BEGIN 2 */
 
 /* USER CODE END 2 */
 
 /* Infinite loop */
 /* USER CODE BEGIN WHILE */
 while (1)
 {
 /* USER CODE END WHILE */
 
 /* USER CODE BEGIN 3 */
 lcd_gotoxy(0,0);
 lcd_puts("10");
 HAL_Delay(10);
 HAL_GPIO_WritePin(GPIOC, LED_STM_ON_Pin, GPIO_PIN_SET);
 HAL_Delay(100);
 HAL_GPIO_WritePin(GPIOC, LED_STM_ON_Pin, GPIO_PIN_RESET);
 }
 /* USER CODE END 3 */
}

I attached the library that I used and a picture of CubeMX.

I would appreciate any help.

Ali/

#[LCD/LTDC]​  #[STM32 MCUs]​  #STM32F1

This topic has been closed for replies.

6 replies

Tesla DeLorean
Guru
May 7, 2022

Try initializing the LCD *after* you have initialized the GPIO, etc​

Tips, Buy me a coffee, or three.. PayPal Venmo (See Profile) Up vote any posts that you find helpful, it shows what's working..
ATavo.1
ATavo.1Author
Associate III
May 7, 2022

Nothing happened. Still the same.

MM..1
Super User
May 7, 2022

LCD have RW pin too , how you manage it?.

ATavo.1
ATavo.1Author
Associate III
May 7, 2022

always 0. in board with ground.

Michal Dudka
Lead
May 8, 2022

If you are using well "proved" library wrong pinout is the most common mistake. Your library looks "unproven", then there can be multiple errors. First question is communication timing. Does your library comply all timing requirements for ENABLE pin pulse, hold a setup times on all signals ? From breif view at your code it look like no. Another common mistake is initialisation sequence (and its timing). Find some proven library or thoroughly read HD447800 datasheet, especially initialisation.

MM..1
Super User
May 8, 2022