
34#!##1
User
’
s Manual
12-14
1999-08
12.6
Error Detection Mechanisms
The SSC is able to detect four different error conditions. Receive Error and Phase Error
are detected in all modes, while Transmit Error and Baudrate Error only apply to slave
mode. When an error is detected, the respective error flag is set. When the
corresponding Error Enable Bit is set, also an error interrupt request will be generated
by setting SSCEIR (see figure below). The error interrupt handler may then check the
error flags to determine the cause of the error interrupt. The error flags are not reset
automatically (like SSCEIR), but rather must be cleared by software after servicing. This
allows servicing of some error conditions via interrupt, while the others may be polled by
software.
Note: The error interrupt handler must clear the associated (enabled) errorflag(s) to
prevent repeated interrupt requests.
A
Receive Error
(Master or Slave mode) is detected, when a new data frame is
completely received, but the previous data was not read out of the receive buffer register
SSCRB. This condition sets the error flag SSCRE and, when enabled via SSCREN, the
error interrupt request flag SSCEIR. The old data in the receive buffer SSCRB will be
overwritten with the new value and is unretrievably lost.
A
Phase Error
(Master or Slave mode) is detected, when the incoming data at pin MRST
(master mode) or MTSR (slave mode), sampled with the same frequency as the CPU
clock, changes between one sample before and two samples after the latching edge of
the clock signal (see
“
Clock Control
”
). This condition sets the error flag SSCPE and,
when enabled via SSCPEN, the error interrupt request flag SSCEIR.
A
Baud Rate Error
(Slave mode) is detected, when the incoming clock signal deviates
from the programmed baud rate by more than 100%, i.e. it either is more than double or
less than half the expected baud rate. This condition sets the error flag SSCBE and,
when enabled via SSCBEN, the error interrupt request flag SSCEIR. Using this error
detection capability requires that the slave's baud rate generator is programmed to the
same baud rate as the master device. This feature detects false additional, or missing
pulses on the clock line (within a certain frame).
800
640
122.1 Baud 152.6 Baud 190.7 Baud 8.2
Baud 1.0 KBaud 1.25 KBaud 1.25
Baud 800
Baud 1.0 KBaud 1.56
ms
ms
ms
1
1.25
6.6
ms
ms
ms
800
1
5.2
μ
s
ms
ms
270F
H
30D3
H
FFFF
H
Table 12-1
SSC Baudrate Calculations
(cont
’
d)
Baud Rate for
f
CPU
= ...
16 MHz
20 MHz
25 MHz
Bit Time for
f
CPU
= ...
16 MHz
20 MHz
Reload
Value
(SSCBR)
25 MHz