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

8XC196EA USER’S MANUAL

7.3.5External Interrupt Signal (Port 2)

Port 2, pin 2 can function as the external interrupt (EXTINT) signal or as a general-purpose I/O signal (). To configure port 2, pin 2 as the external interrupt, set P2_DIR.2, P2_MODE.2, and P2_REG.2. Setting the P2_MODE.2 bit could cause the device to set the corresponding interrupt pending bit, indicating an interrupt request; therefore, follow this sequence to prevent a false interrupt request:

1.Disable interrupts by executing the DI instruction.

2.Set P2_DIR.2.

3.Set P2_MODE.2.

4.Set P2_REG.2.

5.Clear the external interrupt pending bit (INT_PEND1.6).

6.Enable interrupts (optional) by executing the EI instruction.

Table 7-11. External Interrupt Signal

External Interrupt

I/O Signal

External Interrupt Signal Description and Considerations

Signal

 

 

 

 

 

EXTINT

P2.2

Description:

 

 

External Interrupt. In normal operating mode, a rising edge on

 

 

EXTINT sets the EXTINT interrupt pending bit. EXTINT is

 

 

sampled during phase 2 (CLKOUT high). The minimum high time

 

 

is one state time.

 

 

In powerdown mode, asserting the EXTINT signal for at least 50

 

 

ns causes the device to resume normal operation. The interrupt

 

 

does not need to be enabled, but the pin must be configured as a

 

 

special-function input. If the EXTINT interrupt is enabled, the

 

 

CPU executes the interrupt service routine. Otherwise, the CPU

 

 

executes the instruction that immediately follows the command

 

 

that invoked the power-saving mode.

 

 

In idle mode, asserting any enabled interrupt causes the device

 

 

to resume normal operation.

 

 

Considerations:

 

 

Setting P2_MODE.2 could cause the microcontroller to set the

 

 

external interrupt pending bit; therefore, to prevent a false

 

 

interrupt request, clear the interrupt pending bit before globally

 

 

enabling interrupts.

 

 

 

7-18

I/O PORTS

7.3.6PWM Signals (Port 11)

The port 11 pins can function as PWM signals or general-purpose I/O signals (Table 7-12). To use a port 11 pin as a PWM signal, set the corresponding P11_MODE bit, selecting special-func- tion mode, and clear the corresponding P11_DIR bit, configuring the pin as a complementary output.

 

 

Table 7-12. PWM Signals

PWM Signal

I/O Signal

 

PWM Signal Description and Considerations

 

 

 

 

PWM7:0

P11.7:0

 

Description:

 

 

 

Pulse Width Modulator Outputs. These are PWM output pins with

 

 

 

high-current drive capability.

 

 

 

Considerations:

 

 

 

Following reset, pins P11.7:0 are weakly pulled high until your

 

 

 

software writes configuration data into P11_MODE.

 

 

 

 

7.3.7Serial I/O Port Signals (Ports 2 and 7)

Some port 2 and 7 pins can function as SIO signals or general-purpose I/O signals (). To use a port 2 or 7 pin as an SIO signal, set the corresponding Px_MODE bit, selecting special-function mode. To configure an SIO signal as a complementary output, clear the corresponding Px_DIR bit. To configure an SIO signal as an input, set the corresponding Px_DIR and Px_REG bits. To configure an SIO signal as an open-drain output, set the corresponding Px_DIR bit.

7-19

8XC196EA USER’S MANUAL

 

 

Table 7-13. SIO Signals

SIO Signal

I/O Signal

 

SIO Signal Description and Considerations

 

 

 

 

RXD0

P2.1

 

Description:

RXD1

P2.4

 

Receive Serial Data 0 and 1. In modes 1, 2, and 3, RXD0 and 1

 

 

 

 

 

 

receive serial port input data. In mode 0, they function as either

 

 

 

inputs or open-drain outputs for data.

 

 

 

Considerations:

 

 

 

Following reset, pins P2.1 and P2.4 are weakly pulled high until

 

 

 

your software writes configuration data into P2_MODE.

 

 

 

 

T2CLK

P7.2

 

Description:

 

 

 

Timer 2 External Clock. External clock for the serial I/O baud-rate

 

 

 

generator input (program selectable).

 

 

 

Considerations:

 

 

 

Following reset, pin P7.2 is weakly pulled high until your software

 

 

 

writes configuration data into P7_MODE.

 

 

 

 

TXD0

P2.0

 

Description:

TXD1

P2.3

 

Transmit Serial Data 0 and 1. In serial I/O modes 1, 2, and 3,

 

 

 

 

 

 

TXD0 and 1 transmit serial port output data. In mode 0, they are

 

 

 

the serial clock output.

 

 

 

Considerations:

 

 

 

Following reset, pins P2.0 and P2.3 are weakly pulled high until

 

 

 

your software writes configuration data into P2_MODE.

 

 

 

 

7.3.8Special Operating Mode Signal (Port 5 Pin 7)

Port 5, pin 7 can function as either the return-from-powerdown signal or as a general-purpose I/O signal (). To use port 5, pin 7 as the return-from-powerdown signal, set P5_MODE.7. When port 5, pin 7 is configured as its special-function signal RPD, the microcontroller automatically configures the pin as an input signal. (It is not necessary to program P5_DIR and P5_REG.)

Table 7-14. Special Operating Mode Signal

Special Operating

I/O Signal

Description

Mode Signal

 

 

 

 

 

RPD

P5.7

Return from Powerdown. Timing pin for the return-from-

 

 

powerdown circuit.

 

 

 

7-20

I/O PORTS

7.3.9Synchronous Serial I/O Port Signals (Port 10)

Some port 10 pins can function as SSIO signals or general-purpose I/O signals (Table 7-15). To use a port 10 pin as an SSIO signal, set the corresponding P10_MODE bit, selecting special-func- tion mode. To configure an SSIO signal as a complementary output, clear the corresponding P10_DIR bit. To configure an SSIO signal as an input, set the corresponding P10_DIR and P10_REG bits. To configure an SSIO signal as an open-drain output, set the corresponding P10_DIR bit.

 

 

Table 7-15. SSIO Signals

SSIO Signal

I/O Signal

 

SSIO Signal Description and Considerations

 

 

 

 

CHS#

P9.2

 

Description:

 

 

 

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.

 

 

 

 

SC0

P10.0

 

Description:

SC1

P10.2

 

Clock Pins for SSIO0 and 1. These pins carry a signal only

 

 

 

 

 

 

during receptions and transmissions. When the SSIO port is idle,

 

 

 

the pin remains either high (with handshaking) or low (without

 

 

 

handshaking).

 

 

 

Considerations:

 

 

 

Following reset, pins P10.0 and P10.2 are weakly held high until

 

 

 

your software writes configuration data into P10_MODE.

 

 

 

For handshaking mode, configure SC1:0 as open-drain outputs.

 

 

 

 

SD0

P10.1

 

Description:

SD1

P10.3

 

Data Pins for SSIO0 and 1. These pins are the data I/O pins for

 

 

 

 

 

 

SSIO0 and 1.

 

 

 

Considerations:

 

 

 

Following reset, pins P10.1 and P10.3 are weakly held high until

 

 

 

your software writes configuration data into P10_MODE.

 

 

 

 

7-21

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