21.07.2015 Views

M16C User Manual.pdf

M16C User Manual.pdf

M16C User Manual.pdf

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Clock-Synchronous Serial I/OMitsubishi microcomputers<strong>M16C</strong> / 62 GroupSINGLE-CHIP 16-BIT CMOS MICROCOMPUTER2.4 Clock-Synchronous Serial I/O2.4.1 OverviewClock-synchronous serial I/O carries out 8-bit data communications in synchronization with the clock. Thefollowing is an overview of the clock-synchronous serial I/O.(1) Transmission/reception format8-bit data(2) Transfer rateIf the internal clock is selected as the transfer clock, the divide-by-2 frequency, resulting from the bitrate generator division, becomes the transfer rate. The bit rate generator count source can be selectedfrom the following: f1, f8, and f32. Clocks f1, f8, and f32 are derived by dividing the CPU’s mainclock by 1, 8, and 32 respectively.Furthermore, if an external clock is selected as the transfer clock, the clock frequency input to the CLKpin becomes the transfer rate.(3) Error detectionOnly overrun error can be detected. Overrun error is an error that occurs when the next data is madeready before the reception buffer register is read.(4) How to deal with an errorWhen receiving data, read an error flag and reception data simultaneously to determine which errorhas occurred. If the data read is erroneous, initialize the error flag and the UARTi receive bufferregister, then receive the data again.To initialize the UARTi receive buffer register1. Set the receive enable bit to “0” (disable reception).2. Set the serial I/O mode select bit to “0002” (invalid serial I/O).3. Set the serial I/O mode select bit.4. Set the receive enable bit to “1” again (enable reception).To transmit data again due to an error on the reception side, set the UARTi transmit buffer registeragain, then transmit the data again.To set the UARTi transmit buffer register again1. Set the serial I/O mode select bits to “0002” (invalidate serial I/O).2. Set the serial I/O mode select bits again.3. Set the transmit enable bit to “1” (enable transmission), then set transmission data in the UARTitransmit buffer register.(5) Function selectionFor clock-synchronous serial I/O, the following functions can be selected:_______ _______(a) CTS/RTS function_______In the CTS function, an external IC can start transmission/reception by inputting an “H” level to the______________CTS pin. The CTS pin input level is detected when transmission/reception starts. Therefore, if thelevel is set to “L” during transmission/reception, it will stop from the next data._______ _______ _______The RTS function informs an external IC that RTS is reception-ready and has changed to “L”. RTSgoes to “H” at the falling edge of the transfer clock._______ _______The clock-synchronous serial I/O has four types of CTS/RTS functions to choose from:326

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!