cancel
Showing results for 
Search instead for 
Did you mean: 

HD44780-LCD driver for STM32F4

Raahul Jagannathan
Associate II
Posted on July 02, 2018 at 12:12

I am trying to interface an STM32F446RE to an LCD display. Ive tried a number of drivers, but none of them seem to work and I am not getting a display on the screen. The backlight is glowing, which means the power source is fine. Could someone direct me to drivers that I could use, or a tutorial that I could follow?

10 REPLIES 10
David SIORPAES
ST Employee
Posted on July 02, 2018 at 12:19

Hello,

here's a very simple but functional driver for a HD44780 compatible display: 

https://github.com/siorpaes/stm32-freqmeter/blob/st7036_display/st7036.c

It uses 4-bit parallel interface.

Posted on July 02, 2018 at 12:44

What am I to do about all the header files you have included in the st7036.h file, if I am using HAL?

Posted on July 02, 2018 at 13:36

Just remove them and use HAL headers.

The adaptation is pretty straightforward: gpio_set/clear() becomes HAL_GPIO_WritePin(). Remove gpio_set_mode() and clock initializations if generating the boilerplate code with CubeMX.

Posted on July 03, 2018 at 07:57

Oh alright Thank a lot for the help. Please tell me one last thing. If I have understood your drivers correctly, there is no function which will take me to a particular X,Y coordinate on the display, right?

Posted on July 03, 2018 at 10:07

You are right, there isn't (I am using a simple one-line display so just coded the ''home'' command) but you can easily add it coding the following command:

0690X0000060LabQAE.png
Posted on July 03, 2018 at 10:18

The original post was too long to process during our migration. Please click on the provided URL to read the original post. https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006I6iL&d=%2Fa%2F0X0000000btq%2FNO6XjcztM5QmEjfdlh5cAuWUeclOA0bK.NiCgdp_DJo&asPdf=false
Posted on July 03, 2018 at 10:58

Watch out for the lousy implemented delay functions: they are 'calibrated' for a F103 running @72MHz. 

henry.dick
Senior II
Posted on July 03, 2018 at 13:51

'

Could someone direct me to drivers that I could use'

they are often fairly simple. the well - written ones are platform independent, as long as you supply a few GPIO routines.

here is one such example: 

https://github.com/dannyf00/My-MCU-Libraries---2nd-try/blob/master/lcd_4bit.c

 

you will need the corresponding .h file. it supports 4bit and 8bit mode, and arbitrary pin connections (so long as the pins are on the same port).

you do need to supply your own GPIO routines, however.

Posted on July 03, 2018 at 13:29

I just changed that. It still isnt working. Were you able to spot anything else wrong.