![](http://datasheet.mmic.net.cn/90000/ML66Q525-NTB_datasheet_3507944/ML66Q525-NTB_266.png)
ML66525 Family User’s Manual
Chapter 11
Serial Port Functions
11 - 35
11.6.2 Receive Operation
UART mode
Figure 11-15 shows the timing diagram of operation during UART reception.
The clock pulse from the baud rate generator (timer 3 for SIO6 and timer 4 for SIO1) or from
an external input is divided by 16 to generate the transmit shift clock.
If an external clock is to be used with the UART mode, input the clock to the receive clock
input pin (RXCn) for SIOn.
The externally input clock is processed as shown in figure 11-11,
and is input to the 1/n (1/16 dividing) dividing counter as the baud rate clock.
The 1/16 dividing circuit remains halted in its reset state until reception begins.
The 7th, 8th
and 9th pulses of the 1/16 divider (values 6, 7 and 8 of the baud rate (1/16) counter in figure
11-15) become the sampling clock for the receive data input pin (RXDn).
The 10th pulse
(value 9 of the baud rate (1/16) counter in figure 11-15) becomes the receive shift clock.
In synchronization with the receive shift clock, the reception circuit controls reception of the
receive data.
A change in the receive data input pin (RXDn) from a High to Low level triggers the reception
operation to start (at this time, SRnREN (bit 7) of SRnCON should be “1”).
If the input signal to the receive data input pin (RXDn) is detected to have changed from a
High to Low level, the 1/16 dividing counter that had been halted in its reset state now begins
to operate.
The start bit (L level) is sampled at the three sampling clocks of the 7th, 8th, and
9th pulses from the 1/16 dividing counter.
If the start bit is at a Low level for two or more
samples, it is judged to be valid.
If not, the start bit is judged invalid, reception operation is
initialized and then halted.
In a similar manner, receive data is sampled at the 7th, 8th, and 9th pulses from the 1/16
dividing counter.
Data that is judged valid is shifted by the 10th clock, or in other words, by
the receive shift clock, into the receive shift register as receive data.
Thereafter, data
reception continues as specified by SRnCON.
The first stop bit (the 1st bit in the case of 2
stop bits) is received and the reception of one frame is completed.
At this time, if the received stop bit is “0”, a framing error is issued.
If the parity is incorrect,
a parity error is issued.
And, if the previously received data has not been read, an overrun
error is issued (the previously received data will be overwritten).
However, at this time, the status register (SnSTAT) is not be updated of the detected error.
Later, the contents of the receive shift register are transferred to SnBUF, a receive complete
signal is generated in synchronization with M1S1 that indicates the beginning of the next
instruction, and at the same timing, the status register (SnSTAT) is updated by the receive
complete signal and each error signal.
The series of receptions is completed.