Добавил:
Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
8xC196EA microcontroller user's manual.1998.pdf
Скачиваний:
52
Добавлен:
23.08.2013
Размер:
8.29 Mб
Скачать

8XC196EA USER’S MANUAL

Table 8-2. Serial Port Control and Status Registers (Continued)

Mnemonic

Address

Description

 

 

 

SP0_CON

1F8BH

Serial Port x Control

SP1_CON

1F9BH

This register selects the serial mode and enables or disables the

 

 

 

 

receiver for all modes. For modes 1 and 3, it enables parity. For

 

 

mode 2, and for mode 3 with parity disabled, it contains the ninth bit

 

 

to be transmitted.

 

 

 

SP0_STATUS

1F89H

Serial Port x Status

SP1_STATUS

1F99H

This register contains the serial port status bits. It has status bits for

 

 

 

 

receive overrun error (OE), transmit buffer empty (TXE), framing

 

 

error (FE), transmit interrupt (TI), receive interrupt (RI), and received

 

 

parity error (RPE) or received bit 8 (RB8). Reading SPx_STATUS

 

 

clears all bits except TXE; writing a byte to SBUFx_TX clears the

 

 

TXE bit.

 

 

 

8.3SERIAL PORT MODES

This section describes the serial port operating modes. Mode 0 is a synchronous mode. Mode 1 is an eight-bit asynchronous mode with optional parity. Modes 2 and 3 are nine-bit asynchronous modes. Like mode 1, mode 3 has optional parity. For mode 2, the SIO flags receptions (by setting the RI status bit and RIx pending bit) only when the ninth data bit received is a one. This is useful for multiprocessor communication, which is described in detail in “Multiprocessor Communications” on page 8-10.

8.3.1Synchronous Mode (Mode 0)

In mode 0, the TXDx pin outputs a set of eight clock pulses, while the RXDx pin either transmits or receives data. Data is transferred eight bits at a time, with the least-significant bit first. Figure 8-3 shows a diagram of the relative timing of these signals.

TXD

 

 

 

 

 

 

 

 

RXD (out)

D0

D1

D2

D3

D4

D5

D6

D7

RXD (in)

D0

D1

D2

D3

D4

D5

D6

D7

 

 

 

 

 

 

 

 

A0109-03

 

 

Figure 8-3. Mode 0 Timing

 

 

 

8-6

Соседние файлы в предмете Электротехника