cancel
Showing results for 
Search instead for 
Did you mean: 

The LCD is working but not showing any character?

ATavo.1
Associate III

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

6 REPLIES 6

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

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..

Nothing happened. Still the same.

MM..1
Chief II

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

always 0. in board with ground.

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
Chief II