cancel
Showing results for 
Search instead for 
Did you mean: 

UART data on LCD display

jissa
Associate II

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.

7 REPLIES 7
jissa
Associate II

Can anybody help me?

 

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

jissa
Associate II

Here I've attached all the files.

Hello jissa, depending on your level expertise, this can be simple or hard.

Please find below a resource that shows you how to interface your LCD.

https://deepbluembedded.com/stm32-lcd-16x2-tutorial-library-alphanumeric-lcd-16x2-interfacing

jissa
Associate II

@Johi, Yes, I'm a beginner in doing this task. I don't think the problem is in the LCD interfacing. I have been facing issues while interfacing "UART and LCD" and "interrupt and LCD". Can anybody suggest any more ideas?

######
Senior

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.

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.