
ML66517 Family User’s Manual
Chapter 12
Serial Port Functions
12 – 35
12.6.2 Receive Operation
UART mode
Figure 12-15 shows the timing diagram of operation during UART reception.
The clock pulse from the baud rate generator (timer 3 or timer 4) or from an external input is divided by 16
to generate the shift clock.
If an external clock is to be used with the UART mode, input the clock to the receive clock I/O pin (RXCn)
for SIOn. The externally input clock is processed as shown in figure 12-11, and is input to the 1/n dividing
counter as the baud rate clock.
The 1/n 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 12-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 12-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 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.