21.07.2015 Views

M16C User Manual.pdf

M16C User Manual.pdf

M16C User Manual.pdf

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

UARTMitsubishi microcomputers<strong>M16C</strong> / 62 GroupSINGLE-CHIP 16-BIT CMOS MICROCOMPUTER(2) Transfer rateThe divide-by-16 frequency, resulting from division in the bit rate generator (BRG), becomes the transferrate. The count source for the transfer rate register can be selected from f1, f8, f32, and the inputfrom the CLK pin. Clocks f1, f8, f32 are derived by dividing the CPU’s main clock by 1, 8, and 32respectively.Table 2.5.2. Example of baud rate settingSystem clock : 16MHzBaud rate(bps)600BRG'scount sourcef8BRG's set value : n Actual time (bps) BRG's set value : n207 (CF16)60195 (5F16)System clock : 7.3728MHzActual time (bps)6001200f8103 (6716)120247 (2F16)12002400f851 (3316)240423 (1716)24004800f1207 (CF16)480895 (5F16)48009600f1103 (6716)961547 (2F16)960014400f168 (4416)1449331 (1F16)1440019200f151 (3316)1923123 (1716)1920028800f134 (2216)2857115 (F16)2880031250f131 (1F16)31250(3) An error detectionIn clock-asynchronous serial I/O mode, detect errors are shown in Table 2.5.3.Table 2.5.3. Error detectionType of errorDescriptionWhen the flag turns onHow to clear the flagOverrun errorFraming errorParity errorError-sum flag• This error occurs when thenext data lines up before thecontent of the UARTi receivebuffer register is read.• The next data is written to theUARTi receive buffer register.• The UARTi receive interruptrequest bit does not go to “1”.• This error occurs when thestop bit falls short of the setnumber of stop bits.• With parity enabled, this erroroccurs when the total numberof 1's in character bits and theparity bit is different from thespecified number.• This flag turns on when anyerror (overrun, framing, orparity) is detected.The error is detectedwhen data istransferred from theUARTi receive registerto the UARTi receivebuffer register.• Set the serial I/O mode selectbits to “0002”.• Set the receive enable bit to“0”.• Set the serial I/O mode selectbits to ”0002”.• Set the receive enable bit to“0”.• Read the lower-order byte ofthe UARTi receive bufferregister.• When all error (overrun,framing, and parity) areremoved, the flag is cleared.349

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

Saved successfully!

Ooh no, something went wrong!