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

8XC196Kx, Jx, CA USER’S MANUAL

16.3.3 Enabling the Oscillator Failure Detection Circuitry

Programming the OFD bit enables circuitry that resets the device when it detects a failed oscillator. (See “Detecting Oscillator Failure” on page 13-12 for details.) To program this bit, you must write the correct value to the location shown in Table 16-5, using slave programming mode. During normal operation, you can determine the value of this bit by reading the USFR (Figure 16-1 on page 16-7). In EPROM packages, the OFD bit can be erased.

Table 16-5. UPROM Programming Values and Locations for Slave Mode

To set this bit

Write this value

To this location

 

 

 

DEI

08H

0718H

 

 

 

DED

04H

0758H

 

 

 

OFD

01H

0778H

Intel manufacturing uses location 2016H to determine whether to program the OFD bit. Customers with QROM or MROM codes who desire the OFD feature should equate location 2016H to the value 0CDEH.

16.4 PROGRAMMING PULSE WIDTH

The programming pulse width is controlled in different ways depending on the programming mode. In all cases, the pulse width must be at least 100 µs for successful programming. In slave programming mode, the pulse width is controlled by the PALE# signal. In auto programming mode, it is loaded from the external EPROM into the PPW register. In serial port programming mode, it is loaded from the test ROM into the SP_PPW register. In run-time programming mode, your software controls the pulse width.

The PPW and SP_PPW registers (Figure 16-2) are identical except for their locations and default values. Both are word registers and both require that the most-significant bit always be set; the remaining bits constitute the PPW_VALUE. To determine the correct PPW_VALUE for the frequency of the device, use the following formula and round the result to the next higher integer.

PPW_VALUE =

Fosc

× Time

1

------------144-------------------

 

 

where:

PPW_VALUE

is a 15-bit word

FOSC

is the input frequency on XTAL1, in MHz

Time

is the duration of the programming pulse, in µs

16-8

PROGRAMMING THE NONVOLATILE MEMORY

The following two examples calculate the PPW_VALUE for a 100-µs pulse width with an 8-MHz and a 16-MHz crystal, respectively.

PPW_VALUE

=

8 × 100

1 =

800

1 = 4.5552 5 =

05H

-----144--------------

---------

 

 

 

 

144

 

 

 

 

PPW_VALUE

=

16 × 100

1

1600

1 =

10.11 11 = 0BH

-------144---------------

 

= ------------

 

 

 

 

144

 

 

 

 

You can use the following simplified equation to calculate the PPW_VALUE for a 100-µs pulse width at various frequencies:

PPW_VALUE = ( 0.6944 × Fosc) – 1

PPW (or SP_PPW)

no direct access

The PPW register is loaded from the external EPROM (locations 14H and 15H) in auto programming mode. The SP_PPW register is loaded from the internal test ROM in serial port programming mode. The default pulse width for serial port programming is longer than required, so you should change the value before beginning to program the device. (See “Changing Serial Port Programming Defaults” on page 16-34.) The PPW_VALUE determines the programming pulse width, which must be at least 100 µs for successful programming.

15

1

PPW14

PPW13

PPW12

7

 

 

 

 

 

 

 

PPW7

PPW6

PPW5

PPW4

 

 

 

 

8

PPW11

PPW10

PPW9

PPW8

 

 

 

0

 

 

 

 

PPW3

PPW2

PPW1

PPW0

 

 

 

 

Bit

Bit

Function

Number

Mnemonic

 

 

 

 

15

1

Set this bit for proper device operation.

 

 

 

14:0

PPW14:0

PPW_VALUE.

 

 

This value establishes the programming pulse width for auto programming

 

 

or serial port programming. For a 100-µs pulse width, use the following

 

 

formula and round the result to the next higher integer. For auto

 

 

programming, write this value to the external EPROM (see “Auto

 

 

Programming Procedure” on page 16-30). For serial port programming,

 

 

write this value to the internal memory (see “Changing Serial Port

 

 

Programming Defaults” on page 16-34).

 

 

PPW_VALUE = ( 0.6944 × Fosc) – 1

Figure 16-2. Programming Pulse Width Register (PPW or SP_PPW)

16-9

8XC196Kx, Jx, CA USER’S MANUAL

16.5 MODIFIED QUICK-PULSE ALGORITHM

Both the slave and auto programming routines use the modified quick-pulse algorithm (Figure 16-3). The modified quick-pulse algorithm sends programming pulses to each OTPROM word location. After the required number of programming pulses, a verification routine compares the contents of the programmed location to the input data. A verification error deasserts the PVER signal, but does not stop the programming routine. This process repeats until each OTPROM word has been programmed and verified. Intel guarantees lifetime data retention for a device programmed with the modified quick-pulse algorithm.

From Auto or Slave

Programming

Start PPW Timer

Write Data to

OTPROM

Enable Interrupts

Enter Idle Mode

Wait for PPW Timer Interrupt

No

Required

 

Writes Done

 

?

 

 

Yes

 

 

 

 

 

Compare Programmed

Locations and Set Flags

Return

A0190-03

Figure 16-3. Modified Quick-pulse Algorithm

16-10

PROGRAMMING THE NONVOLATILE MEMORY

Auto programming repeats the pulse five times, using the pulse width you specify in the external EPROM. Slave mode repeats the pulse until PROG# is deasserted. In slave programming mode, the PALE# signal controls the pulse width. In all cases, the pulse width must be at least 100 µs for successful programming.

16.6 PROGRAMMING MODE PINS

Figure 16-4 illustrates the signals used in programming and Table 16-6 describes them. The EA#, VPP, and PMODE pins combine to control entry into programming modes. You must configure the PMODE (P0.7:4) pins to select the desired programming mode (see Table 16-7 on page 16-14). Each programming routine configures the port 2 pins to operate as the appropriate spe- cial-function signals. Ports 3 and 4 automatically serve as the PBUS during programming.

Programming

VPP

P4.7:0

PBUS

Voltage

EA#

P3.7:0

 

 

4

 

 

PMODE.3:0

P0.7:4

P2.7

PACT#

 

 

P2.6

CPVER

 

 

P2.4

AINC#

 

 

P2.2

PROG#

 

 

P2.1

PALE#/RXD

 

 

P2.0

PVER/TXD

 

8XC196 Device

 

For auto programming, P1.2:1 replace P4.7:6 as the high address bits.

A0314-03

Figure 16-4. Pin Functions in Programming Modes

Table 16-6. Pin Descriptions

 

Special

 

Program-

 

Port Pin

Function

Type

ming

Description

 

Signal

 

Mode

 

 

 

 

 

 

P0.7:4

PMODE.3:

I

All

Programming Mode Select

 

PMODE.0

 

 

Determines the programming mode. PMODE is sampled

 

 

 

 

 

 

 

 

after a device reset and must be static while the part is

 

 

 

 

operating. (Table 16-7 on page 16-14 lists the PMODE

 

 

 

 

values and programming modes.)

 

 

 

 

 

16-11

8XC196Kx, Jx, CA USER’S MANUAL

Table 16-6. Pin Descriptions (Continued)

 

Special

 

Program-

 

Port Pin

Function

Type

ming

Description

 

Signal

 

Mode

 

 

 

 

 

 

P2.0

PVER

O

Slave

Programming Verification

 

 

 

Auto

During slave or auto programming, PVER is updated

 

 

 

 

 

 

 

 

after each programming pulse. A high output signal

 

 

 

 

indicates successful programming of a location, while a

 

 

 

 

low signal indicates a detected error.

 

 

 

 

 

 

TXD

O

Serial

Transmit Serial Data

 

 

 

 

During serial port programming, TXD transmits data from

 

 

 

 

the OTPROM to an external device.

 

 

 

 

 

P2.1

PALE#

I

Slave

Programming ALE Input

 

 

 

 

During slave programming, a falling edge causes the

 

 

 

 

device to read a command and address from the PBUS.

 

 

 

 

 

 

RXD

I

Serial

Receive Serial Data

 

 

 

 

During serial port programming, RXD receives data from

 

 

 

 

an external device.

 

 

 

 

 

P2.2

PROG#

I

Slave

Programming

 

 

 

 

During programming, a falling edge latches data on the

 

 

 

 

PBUS and begins programming, while a rising edge ends

 

 

 

 

programming. The current location is programmed with

 

 

 

 

the same data as long as PROG# remains asserted, so

 

 

 

 

the data on the PBUS must remain stable while PROG#

 

 

 

 

is active.

 

 

 

 

During a word dump, a falling edge causes the contents

 

 

 

 

of an OTPROM location to be output on the PBUS, while

 

 

 

 

a rising edge ends the data transfer.

 

 

 

 

 

P2.4

AINC#

I

Slave

Auto-increment

 

 

 

 

During slave programming, this active-low input enables

 

 

 

 

the auto-increment feature. (Auto increment allows

 

 

 

 

reading or writing of sequential OTPROM locations,

 

 

 

 

without requiring address transactions across the PBUS

 

 

 

 

for each read or write.) AINC# is sampled after each

 

 

 

 

location is programmed or dumped. If AINC# is asserted,

 

 

 

 

the address is incremented and the next data word is

 

 

 

 

programmed or dumped.

 

 

 

 

 

P2.6

CPVER

O

Slave

Cumulative Program Verification

 

 

 

 

During slave programming, a high signal indicates that all

 

 

 

 

locations programmed correctly, while a low signal

 

 

 

 

indicates that an error occurred during one of the

 

 

 

 

programming operations.

 

 

 

 

 

P2.7

PACT#

O

Auto

Programming Active

 

 

 

ROM-

During auto programming or ROM-dump, a low signal

 

 

 

dump

 

 

 

indicates that programming or dumping is in progress,

 

 

 

 

 

 

 

 

while a high signal indicates that the operation is

 

 

 

 

complete.

 

 

 

 

 

16-12

 

 

 

 

PROGRAMMING THE NONVOLATILE MEMORY

 

 

Table 16-6. Pin Descriptions (Continued)

 

 

 

 

 

 

Special

 

Program-

 

Port Pin

Function

Type

ming

Description

 

Signal

 

Mode

 

 

 

 

 

 

P4.7:0,

PBUS

I/O

Slave

Address/Command/Data Bus

P3.7:0

 

 

 

During slave programming, ports 3 and 4 serve as a

 

 

 

 

 

 

 

 

bidirectional port with open-drain outputs to pass

 

 

 

 

commands, addresses, and data to or from the device.

 

 

 

 

Slave programming requires external pull-up resistors.

 

 

 

 

 

P1.2:1

PBUS

I/O

Auto

Address/Command/Data Bus

P4.7:5,

 

 

ROM-

During auto programming and ROM-dump, ports 3 and 4

P3.7:0

 

 

dump

 

 

serve as a regular system bus to access external

 

 

 

 

 

 

 

 

memory.

 

 

 

 

P4.6 and P4.7 are left unconnected; P1.2 and P1.1 serve

 

 

 

 

as the upper address lines.

 

 

 

 

 

EA#

I

All

External Access

 

 

 

 

Controls program mode entry. If EA# is at VPP voltage on

 

 

 

 

the rising edge of RESET#, the device enters

 

 

 

 

programming mode.

 

 

 

 

EA# is sampled and latched only on the rising edge of

 

 

 

 

RESET#. Changing the level of EA# after reset has no

 

 

 

 

effect.

 

 

 

 

 

V PP

I

All

Programming Voltage

 

 

 

 

During programming, the VPP pin is typically at +12.5V

 

 

 

 

(VPP voltage). Exceeding the maximum VPP voltage speci-

 

 

 

 

fication can damage the device.

 

 

 

 

 

16-13

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