2018-07-02 03:12 AM
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?
2018-07-02 03:19 AM
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.
2018-07-02 05:44 AM
What am I to do about all the header files you have included in the st7036.h file, if I am using HAL?
2018-07-02 06:36 AM
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.
2018-07-03 12:57 AM
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?
2018-07-03 03:07 AM
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:
2018-07-03 03:18 AM
2018-07-03 03:58 AM
Watch out for the lousy implemented delay functions: they are 'calibrated' for a F103 running @72MHz.
2018-07-03 04:51 AM
'
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.
2018-07-03 06:29 AM
I just changed that. It still isnt working. Were you able to spot anything else wrong.