AT32F421
Series Reference Manual
2022.11.11
Page 297
Rev 2.02
17.3.5 Tamper detection
The ERTC offers one tamper detection mode: TAMP1. It can be configured as a level detection with
filter or edge detection. TAMP1 is mapped onto the tamper pin ERTC_MUX1.
The TP1F will be set when a valid tamper event is detected. An interrupt will also be generated if a
tamper detection interrupt is enabled. If the TPTSEN bit is already set, a time stamp event will be
generated accordingly. Once a tamper event occurs, the battery powered registers will be reset so as
to ensure data security in the battery powered domain.
How to configure edge detection
1.
Select edge detection by setting TPFLT=00, and select a valid edge (TP1EDG)
2.
According to your needs, configure whether to activate a time stamp on a tamer event (TPTSEN=1)
3.
According to your needs, enable a tamper detection interrupt (TPIEN=1)
4.
Enable TAMP1 (setting TP1EN=1)
How to configure level detection with filter
1.
Select level detection with filter, and valid level sampling times (TPFLT
≠
00)
2.
Select tamper detection active level (TP1EDG)
3.
Select tamper detection sampling frequency (through the TPFREQ bit )
4.
According to your needs, enable tamper detection pull-up (setting TPPU=1). When TPPU=1 is
asserted, tamper detection pre-charge time must be configured through the TPPR bit
5.
According to your needs, configure whether to activate a time stamp on a tamper event
(TPTSEN=1)
6.
According to your needs, enable a tamper interrupt (TPIEN=1)
7.
Enable TMAP1 by setting TP1EN=1.
While configuring edge detection mode, the following two points deserve our attention:
1.
If a rising edge is configured to enable tamper detection, and the tamper detection pin turns to high
level before tamper detection is enabled, then a tamper event will be detected right after the tamper
detection is enabled;
2.
If a falling edge is configured to enable tamper detection, and the tamper detection pin turns to low
level before tamper detection is enabled, then a tamper event will be detected right after the tamper
detection is enabled.
17.3.6 Multiplexed function output
ERTC provides a set of multiplexed function output for the following events:
1.
Clocks calibrated (OUTSEL=0 and CALOEN=1)
Output 512Hz (CALOSEL=0)
Output 1Hz (CALOSEL=1)
2.
Alarm clock A (OUTSEL=1)
3.
Wakeup events (OUTSEL=3)
When alarm clock or wakeup events are selected (OUTSEL≠0), it is possible to select output type (open-
drain or push-pull) with the OUTTYPE bit, and output polarity with the OUTP bit.
17.3.7 ERTC wakeup
ERTC can be woken up by alarm clocks, time stamps or tamper events. To enable an ERTC interrupt,
configure as follows:
1.
Configure the EXINT line corresponding to ERTC interrupts as an interrupt mode and enable it,
and select a rising edge
2.
Enable a NVIC channel corresponding to an ERTC interrupt
3. Enable an ERTC interrupt
lists the ERTC clock sources, events and interrupts that are able to wakeup low-power
modes.