24.6.8.4.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 directly routed over critical components on the board using the RTC OUT output pin to one RTC INn input pin. 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).

Follow these steps to enable the Active Layer Protection:
  1. 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 route the signal to the external pins.
  2. Select the frequency of the output signal by configuring the RTC Active Layer Frequency field in the Control B register (CTRLB.ACTF).

    GCLK_RTC_OUT  = CLK_RTC 2 CTRLB.ACTF + 1

  3. 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 the INn and OUTn pins are used, the value of the INn pin is sampled on the rising edge of CLK_RTC and compared to the expected value of OUTn. Therefore up to one CLK_RTC period is available for propagation delay through the trace.
  4. Select Active Layer Monitoring Source (TrustRAM or INn/OUTn tamper pins) using the ALSIn bit of the TAMPCTRLB register.
  5. Enable Active Layer Protection by setting the CTRLB.RTCOUT bit.
Important: When the RTC is disabled (writing CTRLA.ENABLE = 0) the SYNCBUSY.ENABLE will be set to ‘0’ before the TAMPER detection is disabled. Changing the tamper configuration (TAMCTRL, TAMPCTRLB, CTRLB,EVCTRL) during that time can produce a false tamper detection. After the fall of SYNCBUSY.ENABLE, the firmware must wait for at least 1 RTC clock period before changing the tamper configuration.