03.01.2015 Views

80C186EC/80C188EC Microprocessor User's Manual

80C186EC/80C188EC Microprocessor User's Manual

80C186EC/80C188EC Microprocessor User's Manual

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.

SERIAL COMMUNICATIONS UNIT<br />

The RX machine can detect several error conditions that may occur during reception:<br />

1. Parity errors — A parity error flag is set when the parity of the received data is incorrect.<br />

2. Framing errors — If a valid stop bit is not received when expected by the RX machine, a<br />

framing error flag is set.<br />

3. Overrun errors — If SxRBUF is not read before another reception completes, the old data<br />

in SxRBUF is overwritten and an overrun error flag is set. This indicates that data from an<br />

earlier reception has been lost.<br />

The RX machine also recognizes two different break characters. The shorter break character is M<br />

bit times, where M is equal to the total number of bits (start + data + stop) in a frame. The longer<br />

break character is 2M + 3 bit times. A break character results in at least one null (all zero) character<br />

with a framing error being received. Other error flags could be set depending on the length<br />

of the break character and the mode of the serial port.<br />

11.1.1.2 TX Machine<br />

A block diagram of the TX machine is shown in Figure 11-3. The TX machine logic supports the<br />

following features:<br />

• parity generation (even, odd or none)<br />

• Clear-to-Send<br />

• break character transmission<br />

• double-buffered operation<br />

A transmission begins by writing a byte to the Serial Transmit Buffer (SxTBUF) Register. SxT-<br />

BUF is a holding register for the transmit shift register. The contents of SxTBUF are transferred<br />

to the transmit shift register as soon as it is empty. If no transmission is in progress (i.e., the transmit<br />

shift register is empty), SxTBUF is copied immediately to the transmit shift register. If parity<br />

is enabled, the parity bits are calculated and appended to the transmit shift register during the<br />

transfer. The start and stop bits are added when the data is transmitted. The Transmit Interrupt bit<br />

(TI) is set at the beginning of the stop bit time.<br />

Double buffering is a useful feature of the TX machine. When the transmit shift register is empty,<br />

the user can write two sequential bytes to SxTBUF. The first byte is transmitted immediately and<br />

the second byte is held in SxTBUF until the first byte has been transmitted.<br />

11-4

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

Saved successfully!

Ooh no, something went wrong!