23.6.8.5.2 Active Layer Protection
The RTC provides a mean of detecting broken traces on the PCB, also known as Active Layer Protection. In this mode, a generated internal RTC signal can be routed over critical components on the board using the RTC OUT output pin to one of the RTC INn input pins. A tamper condition is detected if there is a mismatch on the generated RTC signal.
The Active Layer Protection mode and the generation of the RTC signal is enabled by setting the RTCOUT bit in the Control B register (CTRLB.RTCOUT).
- Enable the RTC prescaler output by writing a one to the RTC Out bit in the Control B register (CTRLB.RTCOUT). The I/O pins must also be configured to correctly route the signal to the external pins.
- Select the frequency of the
output signal by configuring the RTC Active Layer Frequency field in the Control
B register (CTRLB.ACTF).
- Enable the tamper input n (INn) in Active Layer mode by writing 3 to the corresponding Input Action field in the Tamper Control register (TAMPCTRL.INnACT). When active layer protection is enabled and INn and OUT pin are used, the value of INn is sampled on the falling edge of CLK_RTC and compared to the expected value of OUT. Therefore up to one half of a CLK_RTC period is available for propagation delay through the trace.
- Enable Active Layer Protection by setting the CTRLB.RTCOUT bit.
The following sequence must be followed once the RTC enabled (CTRLA.ENABLE = 1):
- Wait for 10 RTC clock periods
- Clear the TAMPID register
- Clear the INTFLAG.TAMPER bit
- Clear the TAMPID register
- Do a dummy read of the TIMESTAMP register