Skip to main content
jissa
Associate II
September 28, 2023
Question

UART data on LCD display

  • September 28, 2023
  • 7 replies
  • 6782 views

I am trying to communicate 2 STM32F103C6. My task is to display UART receiving data on LCD(LM016L). 

Also, my other task is to display interrupt data on LCD. Both should be worked on at the same time. ie, Whenever an interrupt happens it should be printed on LCD.

In both tasks, my LCD is not displaying data.

This topic has been closed for replies.

7 replies

jissa
jissaAuthor
Associate II
September 28, 2023

Can anybody help me?

 

bngstskn
Associate III
September 28, 2023

You need to upload your codes for help. And it would be good if you share your pin connection diagram as well.

jissa
jissaAuthor
Associate II
September 30, 2023

Here I've attached all the files.

######
Senior II
October 2, 2023

Hi Jissa,

I suggest you break your project into 2 stages that you can try and work independently before bringing them together. 

Task 1) Can you get a defined text string or character displaying on the LCD e.g. "Hello World", and can you then update one or all of the characters after a HAL delay (for example).

Task 2) Can you transmit from one STM32 using HAL_UART_Transmit() function and receive it using HAL_UART_Receive(). Both of these functions are blocking which means that the code will sit and wait until the process has finished or timed out.

Once you can do both of these steps then I suggest trying it all together.

I wouldn't move onto the _IT variants until you have proved you can do this. For HAL_UART_Transmit_IT() this is essentially the same as HAL_UART_Transmit() except an interrupt will trigger after the transmit has occured and it is non blocking. I don't think you require this function.

Finally looking at your code for LCD update on receive, you seem to have the LCD update command outside of the flag check, I might suggest you move it to within flag, to only update when you get new data.

Hope this helps.

jissa
jissaAuthor
Associate II
October 5, 2023

Thank you for your response. I got the output. It was a fundamental mistake. I declared an array for receiving value but didn't put it in the loop to read and display on the screen.

Thank you all.