43 lines
784 B
Markdown
43 lines
784 B
Markdown
|
|
## Exercise 06: RTC Check (PCF8563)
|
||
|
|
|
||
|
|
This exercise validates RTC read/write and power-off persistence on the T-Beam Supreme.
|
||
|
|
|
||
|
|
It:
|
||
|
|
- Initializes PMU + I2C bus used by RTC.
|
||
|
|
- Reads RTC at startup.
|
||
|
|
- Prints RTC every 10 seconds.
|
||
|
|
- Accepts serial commands:
|
||
|
|
- `show`
|
||
|
|
- `set YYYY-MM-DD HH:MM:SS`
|
||
|
|
- `help`
|
||
|
|
|
||
|
|
## Build
|
||
|
|
|
||
|
|
```bash
|
||
|
|
source /home/jlpoole/rnsenv/bin/activate
|
||
|
|
pio run -e node_a
|
||
|
|
```
|
||
|
|
|
||
|
|
## Upload
|
||
|
|
|
||
|
|
```bash
|
||
|
|
source /home/jlpoole/rnsenv/bin/activate
|
||
|
|
pio run -e node_a -t upload --upload-port /dev/ttyACM0
|
||
|
|
```
|
||
|
|
|
||
|
|
## Monitor
|
||
|
|
|
||
|
|
```bash
|
||
|
|
screen /dev/ttyACM0 115200
|
||
|
|
```
|
||
|
|
|
||
|
|
## Suggested Persistence Test
|
||
|
|
|
||
|
|
1. Set the RTC:
|
||
|
|
- `set 2026-02-14 17:30:00`
|
||
|
|
2. Confirm:
|
||
|
|
- `show`
|
||
|
|
3. Power off the unit for a few minutes.
|
||
|
|
4. Power on and run:
|
||
|
|
- `show`
|
||
|
|
5. Compare expected elapsed time vs RTC output.
|