cancel
Showing results for 
Search instead for 
Did you mean: 

Help with RTC on Nucleo-F401 to display time on SSD1306 LCD

adityapruthi01
Associate II

Hello all, 
I'm new to STM32, I have been given a project to display the time and date on either an 16x2 lcd or an oled display using the internal RTC of my board. 
I have the STM32 Nucleo f401re.
Can somebody help me?
Thanks and Regards

16 REPLIES 16
SofLit
ST Employee

Hello @adityapruthi01 and welcome to the community,

What kind of help you are looking for? did you have an issue with a project or you didn't start at all?

Inspire from this example: https://github.com/STMicroelectronics/STM32CubeF4/tree/master/Projects/STM324xG_EVAL/Examples/RTC/RTC_Calendar

For LCD 16x2 lcd such as HD44780, you can find something on the internet:

https://community.st.com/t5/stm32-mcus-touchgfx-and-gui/i-am-trying-to-run-lcd-16x2-hd44780-using-stm32f4-discovery/td-p/382585

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

 

 

To give better visibility on the answered topics, please click on "Accept as Solution" on the reply which solved your issue or answered your question.
Andrew Neil
Evangelist III

Welcome to the forum

 


@adityapruthi01 wrote:

I'm new to STM32


Do you have any experience with any other microcontrollers? With programming in general?

 


@adityapruthi01 wrote:

I have been given a project to display the time and date on either an 16x2 lcd or an oled display using the internal RTC of my board. 


So what have you tried so far?

Should be RTC examples available for the Nucleo f401re ...

https://www.youtube.com/watch?v=pkT1asykALk

https://www.youtube.com/watch?v=eumKLXNlM0U

https://www.youtube.com/watch?v=gL8OoS9E1rw&list=PLnMKNibPkDnFCosVVv98U5dCulE6T3Iy8&pp=iAQB

Hi @SofLit 
Thank you so much for responding.
I did try to see some git hub repository, https://github.com/guiguitz/RTC-OLED-Application like this. 
I downloaded the zip file and from there headed to project file and ran it.

SSD1306 STM32Fxxx DESCRIPTION

VCC3.3V-5V-
GNDGND-
SCLPB6-PB8Serial clock line
SDAPB7-PB9Serial data line

I connected the oled as mentioned inside the repository for configuring the oled with my board.
I tried to run this on the STM32 Cube IDE but the oled won't turn on.
I don't even know what this code does.
Thanks for the links, i will just take a look.



Check your connections, wiring continuity, the LCD power supply etc .. This is what you need to do as a first step, then with a logic analyzer check SDA, SCL signals.

Otherwise, contact the developers.

To give better visibility on the answered topics, please click on "Accept as Solution" on the reply which solved your issue or answered your question.

I would certainly suggest that you start with one of ST's own tutorials/examples.

You didn't say if you have any prior microcontroller experience?

The standard approach is to start simple, and build up step-by-step - don't leap straight into trying to do the entire project all at once!

Certainly the display is an advanced part of this project - start with basics before that.

https://community.st.com/t5/stm32-mcus-products/for-better-learning-stm32-programming-and-debugging/m-p/719485/highlight/true#M260696

https://community.st.com/t5/stm32-mcus-products/for-better-learning-stm32-programming-and-debugging/m-p/719468/highlight/true#M260690

 

Hi @Andrew Neil
Thanks for replying.
Yes, I do have some experience with arduino board and esp boards, but only upto arduino IDE.
Thanks for the videos of the introductions.
But if you do have any content for using oled with the board and displaying the real time, on the oled, it will be very helpful for me. 
Thanking you for you response.
Regards


Hello once again, @SofLit,
The oled is working usually, using the example code, of displaying garbage value on it of humidity sesnor.
I have connected SCL of the display to the PB6 (I2C1_SCL) pin of the board, the SDA to PB7 (I2C1_SDA), VCC to the +3V3, and GND to GND.
The oled is not an issue. 
I tired contacting they seem not to respond. Well, it has only been one day, maybe that's the reason. But i have to complete this round about until 8th novemeber. I'm sorry for this asking this at such a short time, I thought of it as easy as arduino.
Regards



@adityapruthi01 wrote:

But if you do have any content for using oled with the board and displaying the real time, on the oled, it will be very helpful for me. 


Forget about RTC for now and try to display something on the LCD by using the driver provided in the link you shared.

These four files are needed to handle the LCD:

https://github.com/guiguitz/RTC-OLED-Application/blob/main/NUCLEO-F401RE-RTC-OLED-Application/Src/ssd1306.c

https://github.com/guiguitz/RTC-OLED-Application/blob/main/NUCLEO-F401RE-RTC-OLED-Application/Src/fonts.c

https://github.com/guiguitz/RTC-OLED-Application/blob/main/NUCLEO-F401RE-RTC-OLED-Application/Inc/ssd1306.h

https://github.com/guiguitz/RTC-OLED-Application/blob/main/NUCLEO-F401RE-RTC-OLED-Application/Inc/fonts.h

 

To give better visibility on the answered topics, please click on "Accept as Solution" on the reply which solved your issue or answered your question.