Modes 2 And 3 For Multiprocessor Communications - Intel 80C188EC User Manual

Hide thumbs Also See for 80C188EC:
Table of Contents

Advertisement

SERIAL COMMUNICATIONS UNIT
3.
If the Clear-to-Send feature is used, set the CEN bit to enable it.
4.
If receptions are desired, set the REN bit to enable the RX machine. Note the TX machine
need not be explicitly enabled.
At this point, you will be able to transmit and receive in the mode specified. Now that the serial
port is operating, you must correctly interpret its status. This is done by reading the SxSTS reg-
ister (Figure 11-14 on page 11-16) and interpreting its contents. Reading SxSTS clears all bits
except the CTS and TXE bits. SxSTS must first be saved in memory and then each bit can be
interpreted individually.
The RI, TI and TXE bits indicate the condition of the transmit and receive buffers. RI and TI are
also used with the Interrupt Control Unit for interrupt-based communications. The OE, FE and
PE bits indicate any errors when a character is received. Once an error occurs, the appropriate bit
remains set until SxSTS is read. For example, assume a character is received with a parity error
(PE set) and a subsequent error-free character is received. If the SxSTS register was not read be-
tween the two receptions, the PE bit remains set.
11.2.2.2

Modes 2 and 3 for Multiprocessor Communications

Programming for multiprocessor communications is much the same as the stand-alone operation.
The only added complexity is that the ninth data bit must be controlled and interpreted correctly.
The ninth data bit is set for transmissions by setting the TB8 bit in SxCON. TB8 is cleared after
every transmission. TB8 is not double-buffered. This is usually not a problem, as very few bytes
are actually transmitted with TB8 equal to one. When writing TB8, make sure that the other bits
in SxCON are written with their appropriate value.
In Modes 2 and 3, the state of the ninth data bit can be determined by the RB8 bit in SxSTS. RB8
reflects the ninth bit for the character currently in SxRBUF. Note that the RB8 bit shares func-
tionality with the PE bit in SxSTS. When parity is enabled, the PE bit has precedence over RB8.
11.2.2.3
Sending and Receiving a Break Character
The serial port can send as well as receive BREAK characters. A BREAK character is a long
string of zeros. To send a BREAK character, set the SBRK bit in SxCON. SBRK drives the TXD
pin immediately low, regardless of the current serial port mode. The user controls the length of
the BREAK character in software by controlling the length of time that SBRK remains set. When
writing SBRK, make sure the other bits in SxCON retain their current states.
11-14

Advertisement

Table of Contents
loading

This manual is also suitable for:

80c186ec

Table of Contents