Тёмный

RTC in STM32 || LCD 16x2 || HAL || CubeMx 

ControllersTech
Подписаться 38 тыс.
Просмотров 53 тыс.
50% 1

Purchase the Products shown in this video from :: controllerstech.store
________________________________________________________________________________________
To download the code, goto controllerstech.com/internal-...
How to use LCD 16x2 with STM32 • LCD via I2C in STM32 |...
Check out more VIDEOS on MODULES/SENSORS with STM32 • STM32 and SENSORS/MODULES
________________________________________________________________________________________
****** SUPPORT US BY DONATING*****
paypal.me/controllertech
******Join the Membership******
/ @controllerstech
Join the Discord Server / discord
Join the Telegram Group t.me/controllerstechdiscuss
Follow me on Instagram / controllerstech
For more info, visit www.controllerstech.com

Наука

Опубликовано:

 

12 авг 2018

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 125   
@ControllersTech
@ControllersTech 3 года назад
1. For backup register you can write any value you want. Just make sure you check for the same value after reset. 2. Obviously you need an external battery, if you want to keep time when the controller is off. You can connect a 3V battery to Vbat pin. 3. The RTC in F103C8 have some issues with keeping date. I can't do anything about it.. it needs to be fixed from ST.
@fernandocatalani8295
@fernandocatalani8295 2 года назад
I do have 3V conected to Vbat pin. The Registers go back to initial values when the power is turned off... Any idea?
@elmirqarayev9586
@elmirqarayev9586 2 года назад
All your videos are so clear and understandable you are very good about this.
@sysHW
@sysHW 5 лет назад
Thank you man, God bless you. This video so useful .
@pusatberk4193
@pusatberk4193 5 лет назад
Thank you,great video and website
@fvgm
@fvgm 2 года назад
Hi, it works very well with my F407VET6 .
@user-wt3ly9xe7u
@user-wt3ly9xe7u 6 месяцев назад
Thank you man, Please Make a Video on External Crystal RTC Calibration
@TheJosele6
@TheJosele6 4 года назад
Hello, how can I program an alarm for all days of the week? Thank you for the video!!
@7tsu802
@7tsu802 4 года назад
So helpful ! Thank you so much. I did succeeded to run RTC on STM32f103c8t6.
@LuisReyes-zg7mq
@LuisReyes-zg7mq 4 года назад
How did you do it? I can't make It works
@ControllersTech
@ControllersTech 4 года назад
Which controller you have ?
@masterzerox2009
@masterzerox2009 4 года назад
What backup register do you used?
@Crazy-vk5sl
@Crazy-vk5sl 5 лет назад
Thank you. How to set multiple alarms?
@elmirqarayev9586
@elmirqarayev9586 2 года назад
you are great.
@baonguyenthe5970
@baonguyenthe5970 3 года назад
Thank you very much
@024muhamadfauzirochmatullo2
@024muhamadfauzirochmatullo2 3 года назад
thank you for this video, can i make gTime in algorithm? i want to make every 12 PM to 17.00 PM there is variable that will be change.. how do we write in keil u vision?
@user-mh8uz1xf1j
@user-mh8uz1xf1j 5 лет назад
THX,could you show how to adapt arduino librarys for stm32.Thanks again.
@youssefosama4466
@youssefosama4466 2 года назад
do i just connect a 3.3v to v bat if i want to keep track of time when the controller is off ? what is the code i need to achieve that ?
@dioadadosite4516
@dioadadosite4516 Год назад
How can I make the code to read the data from my bmp280 sensor on an lcd display like the one you used?... I can't find the code.
@remellarnvssaditya9411
@remellarnvssaditya9411 3 месяца назад
Can i do this using a STM32F207VCT6 Uc? or do i need to change the clock configuration?
@maxiking3487
@maxiking3487 2 месяца назад
Hi, i am working on a NUCLEO Board with STM32L433. I use the LSE oscillator as clock for the RTC. I have connected a capacitor to the Board and removed SB61. The capacitor gets charged by the Board (i selected 1.5 kOhms resistor). The RTC works fine, but when i press the reset button, the RTC gets reset. Writing and Reading the BR works but after a system reset there is another value than 0x32F2 in the BR and i do not knwo why. Can you help me with this problem? Thanks in advance Max
@misterjacqwelll
@misterjacqwelll 3 года назад
The Alarm dont work for me :S i got the F401RE there are something different to do?
@my_google_arifkhan9358
@my_google_arifkhan9358 3 года назад
my code works fine but how can i make time to 00:00:00 and than increase or decrease the time and than set it to any value manualy and than escape
@nitins7103
@nitins7103 3 года назад
Thank you so much for the tutorial! Can i know how did u get to Ox32F2 in rtc backup register
@ControllersTech
@ControllersTech 3 года назад
I saw it in the example by ST. Anyway you can write any other value also, it doesn't matter what you write. But remember that you need to read the same value that you write. It's only used to prevent the rewriting of time and date if the mcu resets.
@nitins7103
@nitins7103 3 года назад
@@ControllersTech Thanks for being really kind to answer. Much appreciated 🎉🎉🎉🎊
@bautroiEM
@bautroiEM 3 месяца назад
could you build perpetual calendar in STM32 please
@saikrishnakaruturi2958
@saikrishnakaruturi2958 Год назад
Hi sir, I just write the code for alarm and am not using any LCD to display the string. I just toggled the LED to indicate the alarm. But unfortunately the LED is not toggled even the callback function is used. Could you please explain me why it is happening?
@artedesing
@artedesing 5 лет назад
Hello Friend won another subscriber, I could not do this tutorial with my stm32f767zi card,
@masterzerox2009
@masterzerox2009 4 года назад
Excellent video, I'm using the STM32F103C8T6, I runs perfect, but the backup register 0x32F2 doesn't function, what backup register should I use?
@ControllersTech
@ControllersTech 4 года назад
What u mean doesn't function ?
@arturoreyes2925
@arturoreyes2925 4 года назад
Is there any possibility to hold time adding backup battery on Vbat pin? If so, is there some aditional software setup or something? I would like RTC to keep running even when main power supply is off
@ControllersTech
@ControllersTech 4 года назад
Yes you can connect the vbat to hold the time. Just make sure you use the backup register to check if the time is already set or not.
@arturoreyes2925
@arturoreyes2925 4 года назад
@@ControllersTech Yes, I did. But every time I power off the controller, the RTC stops running and stands there until I power it on again. I want it to keep running even when main power supply is off. Is there a easy way to do so?
@devjeetmandal1472
@devjeetmandal1472 4 года назад
First of all thanks for the video. I just have one single doubt. At 4:59, what is the deal with 0x32F2 while setting the backup register? According to the function declaration, it is the data part, then why this data part is 0x32F2. Regards
@ControllersTech
@ControllersTech 4 года назад
It's a constant value need to be written in the backup register. Kind of a way to check whether the rtc was configured properly, before it backs up the data. Why 32f2 ? I really have no idea why that particular value only. It was there in cubemx by default. So i picked it up
@justSdat
@justSdat 3 года назад
I followed your example and applied it on my F030R8. I cannot set the time and date. It always starts from 00:00:00 and 01.01.00 The same issue applies to the alarm. Also I have an error when I try to use the backup register command. Do you have any idea why this is happening? Also, thank you very much for the time spent on the videos, they are amazing and the most helpful.
@ControllersTech
@ControllersTech 3 года назад
Check your manual if it have backup registers. Also see the size, it might be small. There is one more way, without backup register. you set the time, flash the code, comment out the set time function and flash the code.
@justSdat
@justSdat 3 года назад
@@ControllersTech Thank you for the response. Unfortunately I did not find a backup register in the manual and Flashing, commenting and flashing again, does not work either for setting the time and data, nor the alarm time.
@ControllersTech
@ControllersTech 3 года назад
I don't know what you are doing. Flashing thing works pretty well. I have tried it in many situations and it always worked. It's basically the same thing as using a backup register. Make sure your rtc initialisation function Doesn't set the time. Or else it will reset the time whenever you reset the board.
@Bianchi77
@Bianchi77 5 лет назад
How can I save the clock, everytime I turn it off it returns to the time on my init code ?? thanks
@ControllersTech
@ControllersTech 5 лет назад
you can't store the data after the power is off because this is internal RTC and no separate power to the RTC. For that purpose, you can use a RTC module ds1307.
@Cesar-dt9nl
@Cesar-dt9nl 4 года назад
Do you think is possible to show temperature too with the internal sensor?
@ControllersTech
@ControllersTech 4 года назад
Yeah why not.. see the adc video
@TK-wh6lf
@TK-wh6lf 2 года назад
Where i can find cmsis ???
@bayuyutub5206
@bayuyutub5206 Год назад
hello.. i'm using NucleoL412KB and it's code not work always my rtc time is reset.. please help me.. i'm using stanby mode
@iqbalhaziq9529
@iqbalhaziq9529 Год назад
hye bro, where can i get i2c-lcd.c file?
@sumitbisht9658
@sumitbisht9658 2 года назад
thanks for STM32 series , I have a problem when i pressed reset button time saved,and when i plug removed ,time didn't save.
@ControllersTech
@ControllersTech 2 года назад
You need to connect a battery (to vbat pin) to keep the time..
@ravisoni2228
@ravisoni2228 4 года назад
sir i want ro know how to use rtc wakeup alarm of 2sec to wakeup from stop mode? plz help...
@ControllersTech
@ControllersTech 4 года назад
What you want to wake up ? Just use alarm and than write some code when the alarm is triggered..
@Tom-si5bb
@Tom-si5bb Год назад
Hello sir I want to compare the hours with a variable to make certain things work or say for e.g. I want to turn of my system as the rtc struck 11 pm how should I do that? please help
@ControllersTech
@ControllersTech Год назад
write a if condition and check for the hours and minutes and seconds. when the condition is met, put the device in sleep mode. Check the low power modes video for that.
@Tom-si5bb
@Tom-si5bb Год назад
@@ControllersTech Thanks for the help! If possible can you please share the link of the video you are referring to and also a small logic code that I can use....
@bruryuyu
@bruryuyu 4 года назад
If I put a battery on Vb pin? When I turn off it returns to the time on my init code?
@ControllersTech
@ControllersTech 4 года назад
Do this. First set up the clock and flash the code. Than soon comment the setting up the time and date part and flash that code. This shall do the trick
@LuisReyes-zg7mq
@LuisReyes-zg7mq 4 года назад
Could you make a video for BluePill internal RTC? It would help a loy
@ControllersTech
@ControllersTech 4 года назад
RTC in BluePill is messed up. Half the features don't work. Better by a module like DS3231
@caffeinatedinsanity2324
@caffeinatedinsanity2324 3 года назад
Thing is that it doesn't have a hardware calendar, so you'll have to make a software one. It acts more like a real time counter
@smyrtin
@smyrtin 3 года назад
Tell me where i can send beer for this tutorial! Big thanks !
@ControllersTech
@ControllersTech 3 года назад
Link is in the description 😃
@srinuk1536
@srinuk1536 4 года назад
#ControllersTech do videos with explaination,it will help for us.
@ControllersTech
@ControllersTech 4 года назад
That was old video man. I try to explain as much as i can in my new videos..
@atefbenattia913
@atefbenattia913 5 лет назад
Hello, can I use stm32f407vg? and what would it change?
@ControllersTech
@ControllersTech 5 лет назад
I don't think anything will change at all you can try though
@jakubstejskal6806
@jakubstejskal6806 4 года назад
Hello, I can't get my RTC working properly. There is no option for alarm in CubeMx on STM32F103 board, never mind. But my clock running about 3 minutes per second on same setup. Any idea?
@ControllersTech
@ControllersTech 4 года назад
This video is quite old. I'll recheck things with F103 and get back..
@jakubstejskal6806
@jakubstejskal6806 4 года назад
​@@ControllersTech Thank you. Appreciate that. I have played with some settings and find out that AsynchPrediv equaled 23000 makes RTC work just fine (+- 1 second issue per minute i would say). But I cannot find any calculation or explanation of that parameter. Auto prediv 1 sec option makes RTC 1.5 slower compare to real. I am using LSE 32KHz, HSE 8MHz, HLCK 72MHz clock setup.
@ControllersTech
@ControllersTech 4 года назад
If you are feeding LSE 32.768 KHz to the RTC than async pre div of 127 and sync pre div of 255 will give the 1 Hz frequency.. Use LSI 32 KHz than 127 and 249..
@jakubstejskal6806
@jakubstejskal6806 4 года назад
@@ControllersTech True, understand that, but not same for f103 board. There is no synchPrediv option, in datasheet its not mentioned and Asynchprediv can be in range 0x00-0xFFFFF. Manual um1850, page 409. Maybe it can be set to registers directly but that is not my cup of tea.
@LuisReyes-zg7mq
@LuisReyes-zg7mq 4 года назад
I Jakub, did you make it works? I mean, use BluePill with internal RTC
@giannidellaratta6141
@giannidellaratta6141 2 месяца назад
I'm sorry to disturb you, but despite using the battery and regularly accessing the reading and writing of time and date, I have the problem that after any reset, even from debug, I lose the date information, while the clock continues without any problem, I could you help? Thank you
@ControllersTech
@ControllersTech 2 месяца назад
Which mcu ?
@giannidellaratta6141
@giannidellaratta6141 2 месяца назад
STM 32F103Ret thanks​@@ControllersTech
@ControllersTech
@ControllersTech 2 месяца назад
Its a known issue in f103 series. As far as I know, it can't be fixed. You need to use an external RTC.
@giannidellaratta6141
@giannidellaratta6141 2 месяца назад
@@ControllersTech ok Thanks
@nsanandkumarak
@nsanandkumarak 2 года назад
Hi , Thanks for the video.. Sir, can you make a video on temperature drift compensation on RTC. Thanks in advance
@asimabdulqayyum3360
@asimabdulqayyum3360 2 года назад
Hi. I configured the RTC using backup register 1. Now the issue is when i try to assign new time and date, i also have to change the value in backup register, other wise it still have the old time and date. Lets say in future some user want to set his own time and date but he does not have access to change value in back up register to set his own time.So how can this be achieved without changing backup register.
@ControllersTech
@ControllersTech 2 года назад
You can write a function such that after setting the time, it will also change the backup register value. Like counter will increment each time the user sets the time, and this counter value will be set as a backup register value..
@hussainkheti6096
@hussainkheti6096 5 лет назад
when i restart controller its not give update time its start from manually coded time so can we save time on rtc when controller goes to power off ?
@ControllersTech
@ControllersTech 5 лет назад
you can't store the data after the power is off because this is internal RTC and no separate power to the RTC. For that purpose, you can use a RTC module ds1307.
@hussainkheti6096
@hussainkheti6096 5 лет назад
@@ControllersTech really i am your big fan bcoz i like your instance replay.you have code for ds3231 rtc module ?
@ControllersTech
@ControllersTech 5 лет назад
No i don't have the code at the moment but I'll try to publish it soon
@onurolce
@onurolce 4 года назад
It restores TIME from registers but ,t doesn't restore DATE from registers. I made a search for solution in forums but there is no healthy solution for every scenario. Do you have a perfect solution or the best idea is using a DS1307 in real projects ?
@ControllersTech
@ControllersTech 4 года назад
In actual projects, it's better if you go for ds3231 or 1307 rtc modules.
@onurolce
@onurolce 4 года назад
@@ControllersTech Yes it seems so. I've found a DS1307 library and made tests but it doesn't work correct. I think it's better to start from basic level of I2C in STM32 and write our own library for DS1307, is it better right ?
@ControllersTech
@ControllersTech 4 года назад
Yes it's always better to write your own library. Ds1307 is pretty simple thing to interface. Just take a look at it's datasheet. And regarding STM32, if you want to read the data from some particular register of ds1307, use the function hal i2c mem read. It works really well.
@onurolce
@onurolce 4 года назад
@@ControllersTech Now I am looking your I2C videos about how it is working in STM. Then I'll follow your advices.
@onurolce
@onurolce 4 года назад
@@ControllersTech Hi, first I wrote own code for Arduino and made it work then moved STM32CubeIDE and made pinout adjustments, I2C parameters but it did not work. After trying 6 hours I saw that DS1307 doesn't work 3.3V :) So supply my STM32F103C8T6 BluePill board in 5V pin and now it is working but I want to work with 3.3V system. So the best solution looks changing to DS3231, what do you advice ?
@fernandocatalani8295
@fernandocatalani8295 2 года назад
How do i make to not lost values when i reset the uC?
@fernandocatalani8295
@fernandocatalani8295 2 года назад
I mean. When the power off...
@ControllersTech
@ControllersTech 2 года назад
Connect the battery voltage to VBAT pin of the mcu.
@fernandocatalani8295
@fernandocatalani8295 2 года назад
@@ControllersTech I've check the code and compare with your lesson. I was made a mistake in my code. The lesson guide to the solucion! Thank you for share the knowledge with us! Has been help me a lot!!!!
@nandoperu100
@nandoperu100 5 лет назад
Hi Thanks for share your video !! I make a Code for RTC with Keil & True Studio Software but I have a Problem because after reset or power off the Micro-controller the valor for date is lost , showing in the display 01-01-200. For testing I used the chip board STM32F103C8 ( Bluepill) .Let me know if you have some idea for resolve this issue. If you prefer I can send to you the code. For your information the values for "Time " keep running without problem.
@ControllersTech
@ControllersTech 5 лет назад
Internal RTC won't keep the time. Because one you power off the controller, there is no means of power to the RTC. You have to use the ds1307 rtc module, if you want to keep the time
@hjia9721
@hjia9721 3 дня назад
thank you for your video but it doesn't work on STM32F429ZIT6.. i want to know why ... why it doesn't work on lcd .. rtc alarm interrupt work well with usart and led..
@ControllersTech
@ControllersTech 3 дня назад
The problem might be with the interfacing of LCD. First make sure the LCad is working. Then combine it with the RTC.
@hjia9721
@hjia9721 2 дня назад
@@ControllersTech thank you for your reply. To explain my problem situation in more detail, I successed rtc clock on I2C LCD, but alarm interrupt still doesn't work. RTC alarm interrupt work on USART, LED toggle, but not work on LCD. if you don't mind, could you help me on email? I really want to complete this task(RTC alarm interrupt on I2C LCD), but I still haven't solved it even if I search for chatGPT,Google and RU-vid. ++Oh I DID IT haha no need to learn on email thank you again !
@toanmai2371
@toanmai2371 3 года назад
how to connecting LCD 16x2 with STM32 ?
@ControllersTech
@ControllersTech 3 года назад
I have updated the description. You can check now..
@ilayarajamurugan9168
@ilayarajamurugan9168 4 года назад
if config external oscillator RTC NOT WOKING PLZ HELP me
@ControllersTech
@ControllersTech 4 года назад
Which controller and what's the error
@ilayarajamurugan9168
@ilayarajamurugan9168 4 года назад
@@ControllersTech im using STM32H750VB when im config external osc it shows 00 only. Its not working
@bhakara4436
@bhakara4436 10 месяцев назад
for me the time is running fine even after reset but the date is changing ...how can i solve this??
@ControllersTech
@ControllersTech 10 месяцев назад
F103 ?
@bhakara4436
@bhakara4436 10 месяцев назад
yes @@ControllersTech
@bhakara4436
@bhakara4436 10 месяцев назад
what to do?
@ControllersTech
@ControllersTech 10 месяцев назад
Its a bug in f103 I guess. I had the same issue but couldn’t figure it out. I saw it being mentioned in some ST community but there is no solution.
@bhakara4436
@bhakara4436 10 месяцев назад
any alternative for this @@ControllersTech
@user-kq3ds8vt4k
@user-kq3ds8vt4k 4 года назад
Hell, Is this using ds3231?
@ControllersTech
@ControllersTech 4 года назад
No this is inbuilt RTC function.
@bayuyutub5206
@bayuyutub5206 Год назад
Hy.. Can you share code. How to get timestamp. Thank's
@ControllersTech
@ControllersTech Год назад
Link is in the description
@sachindeshpande1
@sachindeshpande1 5 лет назад
Sorry I don't watch videos without voice over. Thanks.
@jobaptist
@jobaptist 3 года назад
you can then create your own stm32 chips by using your shit to create the silicon in your bathroom ....
@sachindeshpande1
@sachindeshpande1 3 года назад
@@jobaptist you idiot.
Далее
DS3231 RTC Module and STM32 || cubeide || I2C-LCD
18:17
STM32Cube  STM32F103 RTC настройка
8:02
Просмотров 20 тыс.
STM32F103C8T6 RTC Encoder Menu
40:33
Просмотров 4,6 тыс.
RTC для STM32F103C8T6
14:05
Просмотров 11 тыс.
🛑 STOP! SAMSUNG НЕ ПОКУПАТЬ!
1:00
Просмотров 189 тыс.
Lid hologram 3d
0:32
Просмотров 10 млн