Difference between revisions of "RTC WatchDog HAT"
From Waveshare Wiki
m (Text replacement - "== Support ==" to "") |
|||
Line 45: | Line 45: | ||
</pre> | </pre> | ||
:[[File:RTC WatchDog HAT 2.png|600px]] | :[[File:RTC WatchDog HAT 2.png|600px]] | ||
+ | ====Add Kernel Mode Driver==== | ||
+ | Note that with this method, you cannot use the above sample program<br> | ||
+ | Modify /boot/config.txt to add <br> at the end | ||
+ | dtoverlay=i2c-rtc,ds3231 | ||
+ | |||
+ | ====Hwclock is simple to use==== | ||
+ | Synchronize System Clock -> Hardware Clock | ||
+ | <syntaxhighlight lang="python"> | ||
+ | sudo hwclock -w | ||
+ | </syntaxhighlight> | ||
+ | Synchronize hardware clock -> system clock | ||
+ | <syntaxhighlight lang="python"> | ||
+ | sudo hwclock -s | ||
+ | #Need to close the network, or close the network time, otherwise it will be changed back | ||
+ | </syntaxhighlight> | ||
+ | Set the hardware clock time: | ||
+ | <syntaxhighlight lang="python"> | ||
+ | sudo hwclock --set --date="9/8/2021 16:45:05" | ||
+ | </syntaxhighlight> | ||
+ | View hardware clock | ||
+ | <syntaxhighlight lang="python"> | ||
+ | sudo hwclock -r | ||
+ | </syntaxhighlight> | ||
+ | Display version information | ||
+ | <syntaxhighlight lang="python"> | ||
+ | sudo hwclock --verbose | ||
+ | </syntaxhighlight> | ||
+ | |||
===WatchDog=== | ===WatchDog=== | ||
In the WatchDog example, it feeds the watchdog chip if the D4 pin toggle. | In the WatchDog example, it feeds the watchdog chip if the D4 pin toggle. |
Revision as of 06:19, 4 July 2022
| ||
Introduction
RTC WatchDog HAT For Raspberry Pi, Auto Reset, High Precision RTC
More |
RTC WatchDog HAT
- MAX705 monitoring circuit with auto reset function
- Incorporates DS3231SN high precision RTC chip, with backup battery holder
- Reset pin selection for swiching watchdog
- Indicator for watchdog output warning
How to use
RTC
Open a terminal and run the following command to download the codes
wget https://www.waveshare.com/w/upload/b/bd/RTC_WatchDog_HAT.zip zip RTC_WatchDog_HAT.zip sudo chmod 777 -R RTC_WatchDog_HAT cd RTC_WatchDog_HAT/RTC
- C examples
cd ~/RTC_WatchDog_HAT/RTC/c/ make clean make sudo ./main
cd ~/RTC_WatchDog_HAT/RTC/python/examples/ sudo python main.py
Add Kernel Mode Driver
Note that with this method, you cannot use the above sample program
Modify /boot/config.txt to add
at the end
dtoverlay=i2c-rtc,ds3231
Hwclock is simple to use
Synchronize System Clock -> Hardware Clock
sudo hwclock -w
Synchronize hardware clock -> system clock
sudo hwclock -s #Need to close the network, or close the network time, otherwise it will be changed back
Set the hardware clock time:
sudo hwclock --set --date="9/8/2021 16:45:05"
View hardware clock
sudo hwclock -r
Display version information
sudo hwclock --verbose
WatchDog
In the WatchDog example, it feeds the watchdog chip if the D4 pin toggle. If the watchdog doesn't be feed in T time, it will cut off the power and the voltage falls to 1.25V, in this case, the MAX705 chip will reset and restart the power. About the time T:
T = 0.7*R*C+1.6s
- R is default 5.1M, and C is default 44uF
- Tge default delay time is 157.08s ±6%
RC are set in the board: