GD32W51x User Manual
1002
Figure 30-4. Manchester synchronous sequence diagram
0
0
1
1
SITYP[1:0]=2
SITYP[1:0]=3
Recovered
clock
Data decoded
by Manchester
D
A
T
A
IN
x
1
0
CHEN
0
0
?
?
Recovered
data
1
0
End of first
synchronization
CKLF[1:0]
First conversion
actually started
Cleared by
CKLFC[1:0]
Clock loss detection
Clock loss detection is to detect whether the channel serial input clock (CKINx signal) is lost,
so as to ensure whether there is any error in the data of serial channel conversion (or
threshold monitor and malfunction monitor). If a clock signal loss event occurs, the given data
should be discarded. When using the clock loss detection function, you must configure the
ckout signal source as the system clock.
The clock loss detection function can be enabled or disabled by the CKLEN bit in
HPDF_CHxCTL register. When the enable clock loss detection function and the clock loss
interrupt CKLIE occur, if a clock loss event occurs, the clock loss flag bit (CKLF) will be set to
1 and a clock loss interrupt will be generated. The corresponding interrupt flag bit can be
cleared by setting CKLFC[1:0] bit field.
When the transceiver of the serial interface has not been synchronized, the clock loss flag bit
is set to 1 and cannot be cleared by the corresponding CKLFC[1:0]. Therefore, the correct
steps to use the clock loss function are as follows:
1.
Enable the channel CHEN = 1.
2.
Check the clock loss flag cyclically and write 1 to the CKLFC of the channel. When it is
confirmed that the CKLF bit is cleared, the serial channel transceiver synchronization is
successful.
3.
Enable clock loss detection function CKLEN = 1. To detect possible clock loss, enable
clock loss interrupt CKLIE = 1.
If the SPI interface is used in the serial channel, the external serial input clock (CKINx signal)
is compared with the serial output clock (ckout signal) when the clock loss detection function
is used. The external serial input clock signal must be inverted at least once every 8 CKOUT
signal cycles, otherwise a clock loss event will occur.