Добавил:
Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
8XC196Kx,8XC196Jx,87C196CA microcontroller family user's manual.1995.pdf
Скачиваний:
70
Добавлен:
23.08.2013
Размер:
3.97 Mб
Скачать

8XC196Kx, Jx, CA USER’S MANUAL

13.5.2 Issuing the Reset (RST) Instruction

The RST instruction (opcode FFH) resets the device by pulling RESET# low for 16 state times. It also clears the processor status word (PSW), sets the master program counter (PC) to 2080H, and resets the special function registers (SFRs). See Table C-2 on page C-2 for the reset values of the SFRs.

Putting pull-ups on the address/data bus causes unimplemented areas of memory to be read as FFH. If unused internal OTPROM memory is set to FFH, then execution from any unused memory locations will reset the device.

13.5.3 Issuing an Illegal IDLPD Key Operand

The device resets itself if an illegal key operand is used with the idle/powerdown (IDLPD) command. The legal keys are “1” for idle mode and “2” for powerdown mode. If any other value is used, the device executes a reset sequence. (See Appendix A for a description of the IDLPD command.)

13.5.4 Enabling the Watchdog Timer

The watchdog timer (WDT) is a 16-bit counter that resets the device when the counter overflows (every 64K state times). The WDE bit (bit 3) of CCR1 controls whether the watchdog is enabled immediately or is disabled until the first time it is cleared. Clearing WDE activates the watchdog. Setting WDE makes the watchdog timer inactive, but you can activate it by clearing the watchdog register. Once the watchdog is activated, only a reset can disable it.

You must write two consecutive bytes to the watchdog register (location 0AH) to clear it. The first byte must be 1EH and the second must be E1H. We recommend that you disable interrupts before writing to the watchdog register. If an interrupt occurs between the two writes, the watchdog register will not be cleared.

If enabled, the watchdog continues to run in idle mode. The device must be awakened within 64K state times to clear the watchdog; otherwise, the watchdog will reset the device, which causes it to exit idle mode.

13.5.5 Detecting Oscillator Failure

The ability to sense an oscillator failure is important in safety-sensitive applications. This device provides a feature that can detect a failed oscillator and reset itself. Low-frequency oscillation, typically 100 KHz or below, is sensed as a failure. If enabled, the oscillator fail detect (OFD) circuitry resets the device in the event of an oscillator failure. This feature is enabled by programming the OFD bit (bit 0) in the USFR. (See “Enabling the Oscillator Failure Detection Circuitry” on page 16-8 for details.)

13-12

14

Special Operating

Modes

CHAPTER 14

SPECIAL OPERATING MODES

The 8XC196Kx, Jx, and CA have two power saving modes: idle and powerdown. They also provide an on-circuit emulation (ONCE) mode that electrically isolates the device from the other system components. This chapter describes each mode and explains how to enter and exit each. (Refer to Appendix A for descriptions of the instructions discussed in this chapter, to Appendix B for descriptions of signal status during each mode, and to Appendix C for details about the registers.)

14.1 SPECIAL OPERATING MODE SIGNALS AND REGISTERS

Table 14-1 lists the signals and Table 14-2 lists the registers that are mentioned in this chapter.

Table 14-1. Operating Mode Control Signals

Port Pin

Signal

Type

Description

Name

 

 

 

 

 

 

 

P2.7

CLKOUT

O

Clock Output

 

 

 

NOTE: Output of the internal clock generator. The CLKOUT fre-

 

 

 

quency is ½ the oscillator input frequency (XTAL1). CLKOUT

 

 

 

has a 50% duty cycle.

 

 

 

 

P2.2

EXTINT

I

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.

 

 

 

If the chip is in idle mode and if EXTINT is enabled, a rising edge on

 

 

 

EXTINT brings the chip back to normal operation, where the first

 

 

 

action is to execute the EXTINT service routine. After completion of

 

 

 

the service routine, execution resumes at the the IDLPD instruction

 

 

 

following the one that put the device into idle mode.

 

 

 

In powerdown mode, asserting EXTINT causes the chip to return to

 

 

 

normal operating mode. If EXTINT is enabled, the EXTINT service

 

 

 

routine is executed. Otherwise, execution continues at the instruction

 

 

 

following the IDLPD instruction that put the device into powerdown

 

 

 

mode.

 

 

 

 

P5.4

ONCE#

I

On-circuit Emulation

(KR, KQ)

 

 

Holding ONCE# low during the rising edge of RESET# places the

P2.6

 

 

 

 

device into on-circuit emulation (ONCE) mode. This mode puts all pins

(Jx, CA,

 

 

into a high-impedance state, thereby isolating the device from other

KT, KS)

 

 

components in the system. The value of ONCE# is latched when the

 

 

 

RESET# pin goes inactive. While the device is in ONCE mode, you

 

 

 

can debug the system using a clip-on emulator. To exit ONCE mode,

 

 

 

reset the device by pulling the RESET# signal low. To prevent

 

 

 

inadvertent entry into ONCE mode, configure this pin as an output.

 

 

 

 

14-1

8XC196Kx, Jx, CA USER’S MANUAL

Table 14-1. Operating Mode Control Signals (Continued)

Port Pin

Signal

Type

Description

Name

 

 

 

 

 

 

 

P5.4

Test-

I/O

Test-mode entry

(CA, KT,

mode

 

If this pin is held low during reset, the device will enter a reserved test

KS)

entry

 

 

mode, so exercise caution if you use this pin for input. If you choose

P2.6

 

 

 

 

to configure this pin as an input, always hold it high during reset and

(KR, KQ)

 

 

ensure that your system meets the VIH specification (see datasheet) to

 

 

 

prevent inadvertent entry into a test mode.

 

 

 

 

RESET#

I/O

Reset

 

 

 

A level-sensitive reset input to and open-drain system reset output

 

 

 

from the microcontroller. Either a falling edge on RESET# or an

 

 

 

internal reset turns on a pull-down transistor connected to the RESET

 

 

 

pin for 16 state times. In the powerdown and idle modes, asserting

 

 

 

RESET# causes the chip to reset and return to normal operating

 

 

 

mode. The microcontroller resets to 2080H.

 

 

 

 

V PP

PWR

Programming Voltage

 

 

 

During programming, the VPP pin is typically at +12.5 V (VPP voltage).

 

 

 

Exceeding the maximum VPP voltage specification can damage the

 

 

 

device.

 

 

 

VPP also causes the device to exit powerdown mode when it is driven

 

 

 

low for at least 50 ns. Use this method to exit powerdown only when

 

 

 

using an external clock source because it enables the internal phase

 

 

 

clocks, but not the internal oscillator.

 

 

 

On devices with no internal nonvolatile memory, connect VPP to VCC.

 

 

 

 

Table 14-2. Operating Mode Control and Status Registers

Mnemonic

Address

Description

 

 

 

CCR0

2018H

Chip Configuration 0 Register

 

 

Bit 0 of this register enables and disables powerdown mode.

INT_MASK1

0013H

Interrupt Mask 1

 

 

Bit 6 of this 8-bit register enables and disables (masks) the

 

 

external interrupt (EXTINT).

INT_PEND1

0012H

Interrupt Pending 1

 

 

When set, bit 6 of this register indicates a pending external

 

 

interrupt.

P2_DIR

1FCBH

Port x Direction

P5_DIR

1FF3H

Each bit of Px_DIR controls the direction of the corresponding pin.

 

 

 

 

Clearing a bit configures a pin as a complementary output; setting

 

 

a bit configures a pin as an input or open-drain output. (Open-

 

 

drain outputs require external pull-ups.)

P2_MODE

1FC9H

Port x Mode

P5_MODE

1FF1H

Each bit of Px_MODE controls whether the corresponding pin

 

 

 

 

functions as a standard I/O port pin or as a special-function

 

 

signal. Setting a bit configures a pin as a special-function signal;

 

 

clearing a bit configures a pin as a standard I/O port pin.

14-2

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