Тёмный

Real Time Clock in STM32 | VIDEO 40 

Matej Blagšič
Подписаться 8 тыс.
Просмотров 13 тыс.
50% 1

RTC Functions: 16:18
Demo Cube configuration: 19:01
Demo Code demonstration: 20:50
In this video I talk about Real Time Clock time keeping in hardware and software and implementation in STM32 with built in RTC peripheral.
Example code can be found on github:
github.com/prtzl/Embedded_vid...
Video series repository:
github.com/prtzl/Embedded_videos

Наука

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

 

6 июл 2024

Поделиться:

Ссылка:

Скачать:

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

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 21   
@ZiclopDevices
@ZiclopDevices 3 года назад
Excellent tutorial!
@mouadmoatassim5344
@mouadmoatassim5344 3 года назад
thank you !
@brunoribeiro7854
@brunoribeiro7854 7 месяцев назад
Thanks!!
@purposeoflife47
@purposeoflife47 3 года назад
thanks
@sudhagarp7237
@sudhagarp7237 Месяц назад
hey man this is sudhagar i have configured alarm a for every 1 second using internal rtc in stm32 with 32.768 lse crystal.i am receiving some gos string in 0 th second in a minute and im writing it on rtc data register the alarm interruptis not generated for 0 th second why?
@justSdat
@justSdat 2 года назад
Amazing video, really useful. I need milisecond precision in my project, but it seems like the values I am getting are decreasing, instead of increasing. I am using an STM32F030R8 with it's onboard RTC. Do you have any ideea why and how I could rectify this?
2 года назад
Tldr: sadly there is no replacement for a dedicated external crystal with a tight tolerance. That's the nature of internal rc based oscillators. I have seen the difference between internal rtc and external crystal. I think that in that case the internal one was gaining millisecond values, reading it with its wakeup interrupt for highest precision. Using external crystal basically stalled this rising and left values very still even in millisecond precision. I do not know of a feature that would mitigate this problem in rtc peripheral. If you find one I would be grateful for a comment of a solution. Hope this helps.
@mejoe444
@mejoe444 Год назад
Hi Matej. How can we pause and reset the running RTC? I want to implement something like a stopwatch. I can now initialize and start the RTC but couldn't find any way to stop or reset it during it is running. Hope you might have an input. Thanks.
Год назад
Hi. What I would do is keep the rtc running and just read the time on request. Let's say for a stopwatch. I would implement a pushbutton interrupt and when it's pressed I would read the time and store it as "start". I would also save the current "stopwatch state as "start" or "begin". Then on the next press I would save the time into "stop" and calculate the difference. Also give that interrupt higher priority so that from the time of pressing the button and reading the current time takes as little as possible. Should not be that hard to implement. Also, dont forget to read the date as well, even if you won't use it, just call the read function on a struct. The peripheral has an internal locking mechanism that prevents further date and time updates in the registers before both time and date were read. Good idea, but people miss that so the time is never updated again after first read and you might think that you messed something up. Hope this helps.
@Roshankattel5
@Roshankattel5 3 года назад
For those who are not getting the correct year and date, change "sDate.Weekday=22" by "s.Date.Date=22". Then you will get the correct year and date of the month while printing through UART.
3 года назад
Thank you, I have fixed "sDate.Date = 22" and added weekday "sDate.WeekDay = RTC_WEEKDAY_MONDAY" for example.
@tienleminh8129
@tienleminh8129 3 года назад
Great video. Could you please make a video about INA219 using STM32 to measure voltage, thank you very much
3 года назад
I already have some similar parts to build a good electronic load, I'll make a video on the project in the future.
@manishsonawane1828
@manishsonawane1828 Год назад
Hi! Thank you for this tutorial. I want to implement Alarm clock using this same STM32 board and have to interface a buzzer with the board for my project in university. Can you please help me. What are the configurations made for the pins PH0 and PH1 (RCC_OSC_IN/OUT)? Thank you!
@manishsonawane1828
@manishsonawane1828 Год назад
Also, I connected serial port via PuTTy but when I run the code, the putty is not showing anything. Did I miss something?
Год назад
In the video you can see only external system clock configured. This one is not used for rtc peripheral. What I failed to mention is the clock tree and the rtc is by default connected to internal clock generator. For best results use an external 32k oscillator. You can configure it in the RCC tab. To use serial port, make sure to connect and configure the correct u(s)art peripheral. On the f4 discovery board, uart is not connected to the built in debugger, but some boards do. Make sure to read the board manual. In case of this discovery board I used external usb to serial converter attached to pins seen in the CubeMx window. Let me know if this answered your question.
@davidespigolon8170
@davidespigolon8170 2 года назад
Can you create a basketball scoreboard with time and shotclock with 74hc595 for 7 segment display.
2 года назад
I would use rtc for time keeping. Maybe use an interrupt triggered by rtc every 1s to decrement the time. You can have a global flag that can disable the countdown when needed. Driver for 7 segment display should not be that difficult to implement, you would just need to use more of them. However I would use (SN)7446 driver that decodes bcd code on 4 bits to 7 segment output. That way you just apply the right combination of bcd pins as they translate to number position and you're set. You will however need at least 4 gpio outputs for each 7 segment display, but should be straightforward to implement. Best of success!
@davidespigolon8170
@davidespigolon8170 2 года назад
@ I think this is correct, would you be able to make a tutorial? I had thought of a ds3231 for rtc
@pawankumarlohar3611
@pawankumarlohar3611 3 года назад
At 3:05 which clock oscillator you had used ?
3 года назад
I salvaged one from a rtc module that was defective, the circuit is just an inverter with two resistors and two capacitors, look it up online
Далее
STM32 Multi ADC DMA method
29:42
Просмотров 4,2 тыс.
STM32 project managed with CMake | VIDEO 46
34:36
Просмотров 20 тыс.
Luiza Rasulova #luizarasulova
00:37
Просмотров 302 тыс.
RTC для STM32F103C8T6
14:05
Просмотров 11 тыс.
STM32: Change clock speed via registers
26:10
Просмотров 9 тыс.
S-Pen в Samsung достоин Золота #Shorts
0:38
Все Смартфоны vivo Серии V30!
24:54
Просмотров 24 тыс.