9.3.9.10.2 Monitors and Reports
When register write protection is enabled, any incorrect access is reported in FLEX_TWI_WPSR.WPVS and in FLEX_TWI_SR.SECE. It is possible to trigger an interrupt by writing a 1 in FLEX_TWI_IER.SECE.
The TWI transfer high-level protocols may include some characters acting as CRC to detect erroneous transfers on the line but this method does not detect totally stuck-at fault outputs. Moreover, it provides a longer response time when considering the Open Systems Interconnection (OSI) model due to its location in higher layers. A timeout function can be added at the device level to detect stuck-at faults. The timeout procedure may also take a long time to report an abnormal transfer back to the host because only high layer software stacks can manage this action.
The timeout procedure may also take a long time to report an abnormal transfer back to the host. TWI embeds an on-the-fly output monitoring to speed-up detection and report. The monitor cannot be disabled for safety reason and only reports an error in the user interface (i.e. there is no action on the transmission path).
Some output pad values are monitored when the transmitter is enabled and a character is being transmitted. The TWI internal outputs are passed through IO multiplexing logic that may be unintentionally badly configured and leads to absence or bad transmission. Other causes of stuck-at can be detected (external cause such as short-circuits or internal cause such as pad buffer transistor failure). As example, a badly re-assigned SDA IO pin (software error) is detected as soon as the TWI starts transmitting a character because it is unlikely for another peripheral sharing the same IO pin to drive the same waveform as the TWI on SDA output.
When the TWI is configured in Host mode (FLEX_TWI_MR.MSTR=1), the TWD and TWCK pad outputs are monitored when a character is being transmitted. When the bit FLEX_TWI_WPSR.PADERR=1, an error has been detected on TWD and/or TWCK. The flag FLEX_TWI_SR.SECE is also set when FLEX_TWI_WPSR.PADERR=1. It is possible to trigger an interrupt by writing a 1 in FLEX_TWI_IER.SECE.
The monitor covers any failure located in the FLEXCOM IO multiplexing downstream circuitry, test logic, output pad buffer and external transmission line from the output pad to any buffering circuitry (if discrete components are placed between the transmitter and far-end receiver).