Questions tagged [real-time-clock]

Quoting Wikipedia:

A real-time clock (RTC) is a computer clock (most often in the form of an integrated circuit) that keeps track of the current time.

Micro controllers, Android, related assembly (or low-level) code are concepts that usually accompany so make sure you pick the right one.

199 questions
3
votes
2 answers

How datetime.datetime.now() works without internet connection?

In python, by importing datetime module and using various functions of class datetime.datetime we could get basic dates with formatting and even date arithmetic for deployment. For example, datetime.datetime.now() will return today's date. But,…
S.Rakin
  • 812
  • 1
  • 11
  • 24
3
votes
2 answers

How to get millisecond resolution from DS3231 RTC

How to get accurate milliseconds? I need to calculate the delay of sending data from Arduino A to Arduino B. I tried to use DS3231 but I cannot get milliseconds. What should I do to get accurate milliseconds from DS3231?
ahmad
  • 59
  • 1
  • 2
  • 5
3
votes
3 answers

STM32L151 RTC Alarm interrupt

I am having problem with RTC alarm interrupt of STM32L151. I want my program to go to RTC alarm interrupt every second but it does not work. My main funtion: int main(void) { HAL_Init(); SystemClock_Config(); MX_GPIO_Init(); MX_IWDG_Init(); …
uv_utna
  • 41
  • 1
  • 1
  • 3
3
votes
1 answer

STM32F429 Why I can't read RTC?

I have a question about the RTC on STM43F429. I have a board that manages the RTC date and Time with a battery backup. After some test I have this problem: after a reset , when I try to read the RTC time for the first time, the RTC seems stopped (I…
Lorenzo
  • 3,293
  • 4
  • 29
  • 56
3
votes
1 answer

How to use the RTC clock with the STM32 using HSE with PLL

I am using the stm32F0xx series and am trying to get the RTC to work. I have an external 8MHz crystal connected and using PLL to create a sysclk of 48MHz. Obviously I would like to use this clock with the RTC. I have tried the following: //(1) Write…
TracyB
  • 31
  • 1
  • 2
3
votes
1 answer

Write data to RTC spare ram in Linux

My plan is to store data anywhere on the system besides hard drives, and that data can remain there even if the system is powered off. Most Real Time Clock chips have spare RAM that can be used by the user. Though it is a easy task on a…
frico
  • 101
  • 3
3
votes
1 answer

How does android schedule the device to wake up from sleeping state?

When using AlarmManager, Android device can wake up from sleeping at some time. How does Android schedule the wakeup at lower level? I tried using rtcwake, but it fails with rtcwake: /dev/rtc0 not enabled for wakeup events (if I force rtcwake to…
Vi.
  • 37,014
  • 18
  • 93
  • 148
3
votes
1 answer

RTC alarm vs System alarm on ARM (STM32)

I'm learning the stm32F4. There are some confusions I can't really understand. What's the difference between RTC alarm and original system alarm. I only know that the RTC can save more power but nothing else. Can anyone explain to me or make some…
aaa SA
  • 321
  • 1
  • 8
  • 16
3
votes
1 answer

How to put the msp430 to sleep for 12 seconds?

What's the best way to put the MSP430 to sleep for 10 seconds. Speed is not as important as low power usage.
Dan B
  • 31
  • 1
2
votes
1 answer

Precise Time Measurement in STM32MP1 with DWT CYCCNT

I am using OSD32MP1 (based on STM32MP157c) in Production Mode with OpenSTLinux on Core A7 and FreeRTOS on M4. One of the tasks is to timestamp ADC data acquired by M4 at very highspeed, very precisely (think it order of nanosecond to microsecond).…
2
votes
1 answer

How to show real timer clock in pubnub publish and subscribe method

let timer =0; function showTime() { var d = new Date(); document.getElementById("demo").innerHTML = d.toLocaleTimeString(); } function letsGo(duration) { const pubnub = new PubNub({ publishKey:…
2
votes
2 answers

ARM926EJ-S cycle-counter

Im using an ARM926EJ-S and am trying to figure out whether the ARM can give (e.g. a readable register) the CPU's cycle-counter. I guess a # that will represent the number of cycles since the CPU has been powered. In my system i have only Low-Res…
Eyal
  • 43
  • 4
2
votes
1 answer

Regulator configuration for RTC backup battery in i.MX6 PMIC

I'm switching with the phycore i.MX6 som from phytec's dev kit to an own board. The usermanuals for both the som and devkit can be found on phytec's page. Now I want to configure the rtc to keep the time during reboot's and poweroffs. The battery…
2
votes
1 answer

is there a race condition when 2 processes attempt to read the system clock at the same time?

I have 2 processes (not threads) that are supposed to read the system clock at the same time. For this purpose, the first process uses QTime::currentTime(); and the second process uses std::chrono::high_resolution_clock::now(); But when I…
2
votes
0 answers

How to get the hour to restart on a clockTower once it reaches a certain value

When I run my program the hour does not restart back to zero instead it keeps going. For example if Tower A is at 0 and Tower B is at 23 and I want to add 8 hours My code outputs: Tower A is at 9 and Tower B is at 32. public void…
1
2
3
13 14