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
10
votes
3 answers

how to wakeup android phone from sleep?

How to wakeup android phone from sleep (suspend to mem) programmably? I don't want to acquire any wakelock, which means the phone goes into "real" sleep with the cpu disabled. I guess I can use some kind of RTC (real time clock) mechanism? Does…
jiawen
  • 1,198
  • 2
  • 17
  • 29
9
votes
1 answer

STM32 wake up from standby by RTC

I am programming STM32L051R8 and have next problem. I'm trying use standby mode in most part of time, and sometimes wake up by RTC, it is an auto wake-up. If I work without sleep - all works perfectly, I got an RTC interrupt every time, but when I…
luden
  • 113
  • 1
  • 1
  • 4
8
votes
1 answer

STM32 RTC Timeout during initialization

I am trying to initialize the RTC on a STM32F469I-DISCO board. Since I am still learning, I tried to play with the HAL API that allow me to achieve some projects till the day I'll get enough understanding of this microcontroller to play with…
vionyst
  • 487
  • 2
  • 6
  • 14
6
votes
3 answers

How to investigate which process causes wakeups during laptop sleep-mode in MacOS (or Linux)?

My MacBook spontaneously wakes up from sleep mode with high fan activity. I want to do a investigate this in RTC or power settings? Or by strace-ing of processes, etc (using some process/kernel magic!). Hint: It is probably managed by "rtcwake". I…
Sohail Si
  • 2,750
  • 2
  • 22
  • 36
6
votes
2 answers

Why do you need superuser permissions to read the real-time clock on Linux?

The real-time clock /dev/rtc can be read using hwclock -r but only as root. >hwclock -r --debug hwclock from util-linux 2.23.2 hwclock: cannot open /dev/rtc: Permission denied No usable clock interface found. hwclock: Cannot access the Hardware…
Bruce Adams
  • 4,953
  • 4
  • 48
  • 111
5
votes
0 answers

Is there a way to read the current time stored in RTC using windows?

I am looking for a way to query the current RTC from the motherboard while running under windows. I am looking for a simple unaltered time as it is stored in the hardware clock (no drift compensation, no NTP time synchronization, not an old…
ash
  • 51
  • 3
5
votes
4 answers

stm32l4 RTC HAL not working

I'm having a strange behavior with the RTC on a stm32L476 with FreeRTOS. It only reads the first time in RUN mode, RTC is working, because from run to run it saves the value of the internal register and is going up. Also if I do DEBUG when I put…
taquionbcn
  • 543
  • 1
  • 8
  • 25
5
votes
0 answers

Is there a Windows API to re-read CMOS RTC immediately?

In this discussion it is said that Windows re-reads CMOS RTC approximately every hour. Is there an API in Windows to re-read date/time from CMOS RTC immediately? In other words: running a multi-OS machine, there is a need to instruct Windows: "CMOS…
ymz5
  • 61
  • 2
5
votes
1 answer

RTC Week day byte

I am directly reading/writing the RTC through the port 0x70 and 0x71. As per the manual the weekday byte will hold the day of the week with Sunday=1 and values range from 1 to 7. When I read the byte I get today 4, that is Wednesday. Whereas when i…
phoxis
  • 60,131
  • 14
  • 81
  • 117
4
votes
2 answers

Is Thread.Sleep now using high res timer or have Windows 10 changed default system clock frequency?

Thread.Sleep used to be tied to the system clock which clocked in at a interval at roughly 16 ms, so anything below 16ms would yield 16ms sleep. The behaviour seems to have changed some way down the line line. What has changed? Is Thread.Sleep no…
Anders
  • 17,306
  • 10
  • 76
  • 144
4
votes
2 answers

Read RTC in Windows

I'm not a C/ASM developer and I would like to get current date and time from RTC with a Windows program. Here, I found a C code to do this. I changed that code in the following way, and I compiled it with Visual Studio 2017 cl.exe compiler without…
Fabrizio
  • 65
  • 1
  • 5
4
votes
1 answer

How to get current timestamp of realtime-clock (RTC)?

I would like to get the current timestamp of realtime clock in my BASH script. The hwclock command can print out the current time, but it is not timestamp. I have considered parsing hwclock's output and then convert the results to a timestamp, but…
Xavier Young
  • 368
  • 3
  • 8
4
votes
5 answers

I can't get DS3231 RTC to work

I have a DS3231 RTC module and I am trying to read time off of it using my Arduino UNO through I2C. I'm using the sample code provided with the library but it doesn't seem to work. The only thing I get out of the serial monitor is this: 20165-85-165…
Ege F
  • 107
  • 1
  • 1
  • 9
4
votes
2 answers

How to calculate the date after x days in C

I'm programming a microcontroller in C that has an internal RTC and automatically increments a day counter (0-65536). So, given the initial date adjusted by the user (DD/MM/YYYY), I need to keep the calendar updated based on that counter. That is, I…
Daniel Santos
  • 41
  • 1
  • 2
3
votes
0 answers

Is there any .c source file available to convert TAI time to UTC?

I am trying to implement BLE mesh Time model. The time data received from the mesh is in TAI format and i need to use local RTC to keep track of this time. For this, I have to convert the TAI time from mesh to UTC locally so that my node can keep…
1
2 3
13 14