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

SYNCHRONOUS SERIAL I/O (SSIO) PORT

9.2SSIO PORT SIGNALS AND REGISTERS

Table 9-1 and Table 9-2 describe the signals and registers associated with the SSIO port.

 

 

Table 9-1. SSIO Port Signals

Signal

Type

Description

 

 

 

CHS#

I

Channel Select

 

 

This signal is available only when the SSIO is configured for channel-select

 

 

operation. The function of the signal depends on whether the SSIO is

 

 

configured as master or slave. When the SSIO is configured as a slave, an

 

 

external master activates CHS# to communicate with the SSIO. When the

 

 

SSIO is configured as a master, an external master activates CHS# when it

 

 

wants the SSIO to give up the bus.

 

 

CHS# shares a package pin with P10.2.

 

 

 

SC0

I/O

Serial Clock x

SC1

 

In standard mode, SC0 is the serial clock pin for channel 0 and SC1 is the

 

 

 

 

serial clock pin for channel 1. In duplex and channel-select modes, SC0 is

 

 

the serial clock pin for both channels 0 and 1 and SC1 is not available.

 

 

For normal transfers, configure SCx as either a complementary output

 

 

signal (for master) or a high-impedance input signal (for slave). When

 

 

channel x is configured as a master, the serial clock is output on SCx.

 

 

During transfers, the SCx output signal is synchronized with the baud clock;

 

 

between transfers, the SSIO drives SCx to its idle state. When channel x is

 

 

configured as a slave, the serial clock is input on SCx.

 

 

For handshaking transfers, configure SCx as an open-drain signal and use

 

 

an external pull-up resistor. Transfers are initiated only when SCx is high;

 

 

therefore, a slave device can pull SCx low when it is not ready. When

 

 

channel x is configured as a master, the serial clock is output on SCx.

 

 

During transfers, the SCx output signal is synchronized with the baud clock;

 

 

between transfers, the SSIO floats SCx. When channel x is configured as a

 

 

slave, the SSIO pulls SCx low when channel x’s buffer is empty for

 

 

transmissions or full for receptions; it floats SCx when channel x’s buffer is

 

 

full for transmissions and empty for receptions.

 

 

SC0 shares a package pin with P10.0, and SC1 shares a package pin with

 

 

P10.2.

 

 

 

SD0

I/O

Serial Data x

SD1

 

This pin is the serial data pin for channel x. For transmissions, configure

 

 

 

 

SDx as a complementary output signal. For receptions, configure SDx as a

 

 

high-impedance input signal.

 

 

In standard mode, SD0 and SD1 can be configured for either transmissions

 

 

or receptions. In duplex mode, configure SD0 for transmissions and SD1 for

 

 

receptions. In channel-select half-duplex mode, configure SD1 for

 

 

transmissions or receptions. In channel-select full-duplex mode, configure

 

 

SD0 for transmissions and SD1 for receptions.

 

 

SD0 shares a package pin with P10.1, and SD1 shares a package pin with

 

 

P10.3.

 

 

 

9-5

8XC196EA USER’S MANUAL

 

 

Table 9-2. SSIO Port Registers

Mnemonic

Address

Description

 

 

 

INT_MASK1

0013H

Interrupt Mask 1

 

 

Use this register to enable or disable interrupts from the SSIO

 

 

channels.

 

 

As a transmitter, an SSIO channel generates an interrupt request when

 

 

its transmit buffer is empty. As a receiver, an SSIO channel generates

 

 

an interrupt request when its receive buffer is full. As a master, in

 

 

channel-select mode, the SSIO can generate an interrupt request

 

 

when another device takes control of the bus. In this case, the interrupt

 

 

request corresponds to the SSIO0 interrupt mask bit.

 

 

Setting the SSIO0 (INT_MASK1.0) bit of this register enables the SSIO

 

 

channel 0 transfer interrupt or the SSIO channel-select master

 

 

contention interrupt; clearing the bit disables (masks) the interrupt.

 

 

Setting the SSIO1 (INT_MASK1.1) bit of this register enables the SSIO

 

 

channel 1 transfer interrupt; clearing the bit disables (masks) the

 

 

interrupt.

 

 

 

INT_PEND1

0012H

Interrupt Pending 1

 

 

When set, SSIO0 (INT_PEND1.0) indicates a pending SSIO channel 0

 

 

transfer interrupt or SSIO channel-select master contention interrupt.

 

 

When set, SSIO1 (INT_PEND1.1) indicates a pending channel 1

 

 

transfer interrupt.

 

 

 

P10_DIR

1FC3H

Port 10 Direction

 

 

Each bit controls the configuration of the corresponding pin. Clearing a

 

 

bit configures the corresponding pin as a complementary output;

 

 

setting a bit configures the corresponding pin as an open-drain output

 

 

or high-impedance input.

 

 

Write to P10_DIR.0, P10_DIR.1, P10_DIR.2, and P10_DIR.3 to

 

 

configure SC0, SD0, SC1, and SD1. (See “Configuring the SSIO

 

 

Registers” on page 9-12.)

 

 

 

P10_MODE

1FC1H

Port 10 Mode

 

 

Each bit controls the mode of the corresponding pin. Setting a bit

 

 

configures a pin as a special-function signal; clearing a bit configures a

 

 

pin as a general-purpose I/O signal.

 

 

Set P10_MODE.0, P10_MODE.1, P10_MODE.2, and P10_MODE.3 to

 

 

configure pins P10.0, P10.1, P10.2, and P10.3 as SC0, SD0, SC1, and

 

 

SD1. (See “Configuring the SSIO Registers” on page 9-12.)

 

 

 

P10_PIN

1FC7H

Port 10 Pin

 

 

Each bit reflects the current state of the corresponding pin, regardless

 

 

of the pin’s mode and configuration.

 

 

 

9-6

 

 

SYNCHRONOUS SERIAL I/O (SSIO) PORT

 

Table 9-2. SSIO Port Registers (Continued)

 

 

 

Mnemonic

Address

Description

 

 

 

P10_REG

1FC5H

Port 10 Data Output

 

 

For I/O Mode

 

 

When a port pin is configured as a complementary signal, setting

 

 

the corresponding port data bit drives a one on the pin and

 

 

clearing the corresponding port data bit drives a zero on the pin.

 

 

When a port pin is configured as an open-drain signal, clearing the

 

 

corresponding port data bit drives a zero on the pin and setting the

 

 

corresponding port data bit floats the pin, making it available as a

 

 

high-impedance input.

 

 

For Special-function Mode

 

 

When a port pin is configured as an output (either complementary

 

 

or open-drain) signal, the corresponding port data bit value is

 

 

immaterial because the corresponding on-chip peripheral or

 

 

system function controls the pin.

 

 

When a port pin is configured as an open-drain signal, setting the

 

 

corresponding port data bit floats the pin, making it available as a

 

 

high-impedance input.

 

 

Write to P10_REG.0, P10_REG.1, P10_REG.2, and P10_REG.3 to

 

 

configure SC0, SD0, SC1, and SD1. (See “Configuring the SSIO

 

 

Registers” on page 9-12.)

 

 

 

PTSSEL

0004H

PTS Select

 

 

Selects either a PTS microcode routine or a standard interrupt service

 

 

routine for the SSIOx interrupts. Setting the SSIO0 or SSIO1 bit

 

 

(PTSSEL.8 or PTSSEL.9) of this register selects a PTS microcode

 

 

routine; clearing the SSIOx bit selects a standard interrupt service

 

 

routine.

 

 

 

PTSSRV

0006H

PTS Service

 

 

Used by the hardware to indicate that the SSIOx interrupt has been

 

 

serviced by the PTS routine.

 

 

 

SSIO_BAUD

1F94H

SSIO Baud Rate

 

 

Enables the baud-rate generator and defines the baud rate for the

 

 

baud clock.

 

 

 

SSIO0_BUF

1F90H

SSIO x Receive and Transmit Buffers

SSIO1_BUF

1F92H

Contains either received data or data for transmission, depending on

 

 

 

 

the channel configuration. Data is shifted into this register from the SDx

 

 

pin or from this register to the SDx pin, with the most-significant bit first.

 

 

 

SSIO0_CON

1F91H

SSIO x Control

SSIO1_CON

1F93H

Configures the SSIO channel as either master or slave, transmitter or

 

 

 

 

receiver, selects the channel’s transfer type (normal or handshaking),

 

 

determines whether the SSIO enables or disables the channel at the

 

 

completion of a transfer, and indicates the buffer status and whether a

 

 

buffer error occurred in the last transfer.

 

 

 

9-7

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