cancel
Showing results for 
Search instead for 
Did you mean: 

STM32 interface with 16x2 LCD

DJ1
Associate III

I have been trying to interface STM32F401RE development board with 16x2 LCD module. I have tried making my own driver file for the same. I tried changing LCD's twice but still the same, the issue is no data is visible on the LCD . I am working on 4-bit mode for LCD interface. I have also followed a few tutorials on the same but no change. Please do guide for the same.

10 REPLIES 10
DJ1
Associate III
 
S.Ma
Principal

Use if possible a transflexive LCD display, so you can see something even if backlight is off.

A transflexive pixel is half mirror and half backlighted.

I use the classical 16x2 character display with just GPIO bitbang a pseudo SPI to drive the display and it works ok. You can have a look at the code here.

Surely there are some working examples of driving these displays, not sure there's a lot of interest in realigning someone else's wheels.

How many tutorials are needed to re-explain the same functionality? Perhaps find a colleague, supervisor or classmate that can sit and work this through with you?

Perhaps look at Arduino, check the power/function of your display. Check with known to work schematics.

Keil, IAR and Olimex have ALL shipped boards with 4-bit 16x2 LCD displays, with code and wiring that work.

Some of the SSD130x I2C OLEDs are so much cleaner..

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

I would suggest you start with 8-bit first. Then change it to 4-bits.

gbm
Lead III
  1. your delay routine doesn't work.
  2. you must add delay between all commands
  3. init sequence is incorrect
My STM32 stuff on github - compact USB device stack and more: https://github.com/gbm-ii/gbmUSBdevice
DJ1
Associate III

Yes, i have changed a few things in this code. Please do check and let me know. The issue is if i do step by step debugging, data is coming properly but if i just simply run the code then it does not show anything on display. I thought of delay as the reason but even after increasing the delay there is no change in output.

DJ1
Associate III

I have made a few changes and have updated the file. Please do check once!

DJ1
Associate III

If i am doing step by step debugging, for the same code i am getting results but if i just simply run the code it does not working properly. What may be the reason? Please do share your thoughts. Already tried giving delay but that didnt work either.

True but based on requirement 16x2 LCD is the best choice as of now. Have gone through several different websites and followed them but still there are issues. I have already worked with LCD's in past with Arduino and RPi but that wont be of much help in this case. I am already using STM32Cube IDE for development.