Open main menu

DAVE Developer's Wiki β

Changes

DESK-MP1-L/Peripherals/RTC

1,082 bytes added, 11:22, 2 August 2023
no edit summary
<section begin=Body/>
== On-board RTC ==An on-board Maxim Integrated DS3232 device provides a very accurate, temperature-compensated real-time clock (RTC) resource with:
On [[ETRA_SBC | SBC ETRA]] there are two rtc one on [[ETRA_SOM | ETRA SOM]] and one on carrier board. <pre class="workstation-terminal">root@desk-mp1:~# ls -la /dev/rtc* Temperaturelrwxrwxrwx 1 root root 4 Aug 2 10:45 /dev/rtc -> rtc0crw------- 1 root root 253, 0 Aug 2 10:45 /dev/rtc0crw------compensated crystal oscillator- 1 root root 253, 1 Aug 2 10:45 /dev/rtc1</pre> === Device tree configuration === <pre>......&i2c4{ ...* Date ... ds3232: rtc@68 { compatible = "dallas, time and calendards3232"; reg = <0x68>; interrupt-parent = <&gpiod>; interrupts = <6 IRQ_TYPE_EDGE_FALLING>; status = "okay"; }; ... ...};......&rtc{ status = "okay";  /* USER CODE BEGIN rtc * Alarm capability/ /* Backup power from external batteryUSER CODE END rtc */};......</pre> === Linux messages at boot time === <pre class="workstation-terminal">...[ 2.006753] stm32_rtc 5c004000.rtc: registered as rtc0[ 2.010619] stm32_rtc 5c004000.rtc: setting system clock to 2023-08-02T10:45:30 UTC (1690973130)[ 2.019926] stm32_rtc 5c004000.rtc: registered rev:1.2...[ 2.177792] rtc-ds3232 1-0068: registered as rtc1* ±3.5ppm accuracy ..</pre> === Usage === <pre class="workstation-terminal">root@desk-mp1:~# hwclock -f /dev/rtc1 -vhwclock from util-40°C linux 2.37.4System Time: 1690975162.373458Using the rtc interface to +85°C the clock.Assuming hardware clock is kept in UTC time.Waiting for clock tick......got clock tickTime read from Hardware Clock: 2023/08/02 11:19:24Hw clock time : 2023/08/02 11:19:24 = 1690975164 seconds since 1969Time since last adjustment is 1690975164 secondsCalculated Hardware Clock drift is 0.000000 seconds* 236 Bytes of Battery2023-08-Backed SRAM 02 11:19:23.549038+00:00* I²C Interface </pre>
Backup power is provided through the RTC_VBAT. If not used, RTC_VBAT must be externally connected to VCC.
For a detailed description of RTC characteristics, please refer to the DS3232 datasheet.
----
[[Category:ETRA]]
dave_user
223
edits