25.5.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 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).

The selection of the TrustRAM active layer protection is done by setting the Active Layer Internal Select n bit in the TAMPCTRLB register (TAMPCTRLB.ALSIn), while clearing this bit selects the RTC INn and OUTn external protection.

Important: Only one tamper channel must be configured on the TrustRAM, while remaining channels can be independently configured on tamper detection pins.
Note: The Active Layer Protection works with distinct OUTn/INn pins when the Separate Tamper Output bit CTRLB.SEPTO is set. Alternatively, it can work with one output pin (OUT0) and multiple input pin INn. This is achieved by clearing the Separate Tamper Output bit CTRLB.SEPTO. If the TrustRAM active layer protection is selected for a channel and CTRLB.SEPTO is cleared, it will use the same internal signal as OUT0, otherwise it uses the OUTn signal.
Enabling active layer protection requires the following steps:
  • 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).

    GCLK_RTC_OUT  = CLK_RTC 2 CTRLB.ACTF + 1

  • Set the Separate Tamper Output bit CTRLB.SEPTO in case of separate Active Layer Protection channels
  • Clear the Active Layer Internal Select bit n in the TAMPCTRLB register (TAMPCTRLB.ALSIn) to enable the protection using INn and OUTn pins. Set the Active Layer Internal Select bit n in the TAMPCTRLB register (TAMPCTRLB.ALSIn) to enable the protection of the TrustRAM shield.
  • 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 pin are used, the value of the INn 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.
  • Enable the RTC prescaler output and the Active Layer Protection by setting the CTRLB.RTCOUT bit. The I/O pins must also be configured to correctly route the signal to the external pins.