Добавил:
Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
Скачиваний:
4
Добавлен:
18.07.2023
Размер:
8.82 Mб
Скачать

1.Set BS2, BS1 to “00”.

2.Give WR a negative pulse. This starts programming of the EEPROM page. RDY/BSY goes low.

3.Wait until to RDY/BSY goes high before programming the next page (see Figure 30-4 for signal waveforms).

Figure 30-4. Programming the EEPROM Waveforms

 

 

 

 

 

 

 

K

 

 

 

A

G

B

C

E

B

C

E

L

DATA

0x11

ADDR. HIGH

ADDR. LOW

DATA

XX

ADDR. LOW

DATA

XX

 

 

 

 

 

 

 

 

 

 

XA1

 

 

 

 

 

 

 

 

 

XA0

 

 

 

 

 

 

 

 

 

BS1

 

 

 

 

 

 

 

 

 

XTAL1

 

 

 

 

 

 

 

 

 

WR

 

 

 

 

 

 

 

 

 

RDY/BSY

 

 

 

 

 

 

 

 

 

RESET +12V

 

 

 

 

 

 

 

 

 

OE

 

 

 

 

 

 

 

 

 

PAGEL

 

 

 

 

 

 

 

 

 

BS2

 

 

 

 

 

 

 

 

 

30.7.6Reading the Flash

The algorithm for reading the Flash memory is as follows (refer to “Programming the Flash” on page 331 for details on Command and Address loading):

1.A: Load Command “0000 0010”.

2.H: Load Address Extended Byte (0x000xFF).

3.G: Load Address High Byte (0x00 - 0xFF).

4.B: Load Address Low Byte (0x00 - 0xFF).

5.Set OE to “0”, and BS1 to “0”. The Flash word low byte can now be read at DATA.

6.Set BS to “1”. The Flash word high byte can now be read at DATA.

7.Set OE to “1”.

30.7.7Reading the EEPROM

The algorithm for reading the EEPROM memory is as follows (refer to “Programming the Flash” on page 331 for details on Command and Address loading):

1.A: Load Command “0000 0011”.

2.G: Load Address High Byte (0x00 - 0xFF).

3.B: Load Address Low Byte (0x00 - 0xFF).

4.Set OE to “0”, and BS1 to “0”. The EEPROM Data byte can now be read at DATA.

5.Set OE to “1”.

30.7.8Programming the Fuse Low Bits

The algorithm for programming the Fuse Low bits is as follows (refer to “Programming the Flash” on page 331 for details on Command and Data loading):

1.A: Load Command “0100 0000”.

2.C: Load Data Low Byte. Bit n = “0” programs and bit n = “1” erases the Fuse bit.

3.Give WR a negative pulse and wait for RDY/BSY to go high.

ATmega640/V-1280/V-1281/V-2560/V-2561/V [DATASHEET]

334

2549Q–AVR–02/2014

30.7.9Programming the Fuse High Bits

The algorithm for programming the Fuse High bits is as follows (refer to “Programming the Flash” on page 331 for details on Command and Data loading):

1.A: Load Command “0100 0000”.

2.C: Load Data Low Byte. Bit n = “0” programs and bit n = “1” erases the Fuse bit.

3.Set BS2, BS1 to “01”. This selects high data byte.

4.Give WR a negative pulse and wait for RDY/BSY to go high.

5.Set BS2, BS1 to “00”. This selects low data byte.

30.7.10Programming the Extended Fuse Bits

The algorithm for programming the Extended Fuse bits is as follows (refer to “Programming the Flash” on page 331 for details on Command and Data loading):

1.1. A: Load Command “0100 0000”.

2.2. C: Load Data Low Byte. Bit n = “0” programs and bit n = “1” erases the Fuse bit.

3.3. Set BS2, BS1 to “10”. This selects extended data byte.

4.4. Give WR a negative pulse and wait for RDY/BSY to go high.

5.5. Set BS2, BS1 to “00”. This selects low data byte.

Figure 30-5. Programming the FUSES Waveforms

 

 

 

Write Fuse Low byte

 

 

Write Fuse high byte

 

 

Write Extended Fuse byte

 

A

C

 

A

C

 

A

C

 

DATA

0x40

DATA

XX

0x40

DATA

XX

0x40

DATA

XX

 

 

 

 

 

 

 

 

 

XA1

 

 

 

 

 

 

 

 

 

XA0

 

 

 

 

 

 

 

 

 

BS1

 

 

 

 

 

 

 

 

 

BS2

 

 

 

 

 

 

 

 

 

XTAL1

 

 

 

 

 

 

 

 

 

WR

 

 

 

 

 

 

 

 

 

RDY/BSY

 

 

 

 

 

 

 

 

 

RESET +12V

 

 

 

 

 

 

 

 

 

OE

 

 

 

 

 

 

 

 

 

PAGEL

 

 

 

 

 

 

 

 

 

30.7.11Programming the Lock Bits

The algorithm for programming the Lock bits is as follows (refer to “Programming the Flash” on page 331 for details on Command and Data loading):

1.A: Load Command “0010 0000”.

2.C: Load Data Low Byte. Bit n = “0” programs the Lock bit. If LB mode 3 is programmed (LB1 and LB2 is programmed), it is not possible to program the Boot Lock bits by any External Programming mode.

3.Give WR a negative pulse and wait for RDY/BSY to go high.

The Lock bits can only be cleared by executing Chip Erase.

ATmega640/V-1280/V-1281/V-2560/V-2561/V [DATASHEET]

335

2549Q–AVR–02/2014

30.7.12Reading the Fuse and Lock Bits

The algorithm for reading the Fuse and Lock bits is as follows (refer to “Programming the Flash” on page 331 for details on Command loading):

1.A: Load Command “0000 0100”.

2.Set OE to “0”, and BS2, BS1 to “00”. The status of the Fuse Low bits can now be read at DATA (“0” means programmed).

3.Set OE to “0”, and BS2, BS1 to “11”. The status of the Fuse High bits can now be read at DATA (“0” means programmed).

4.Set OE to “0”, and BS2, BS1 to “10”. The status of the Extended Fuse bits can now be read at DATA (“0” means programmed).

5.Set OE to “0”, and BS2, BS1 to “01”. The status of the Lock bits can now be read at DATA (“0” means programmed).

6.Set OE to “1”.

Figure 30-6. Mapping Between BS1, BS2 and the Fuse and Lock Bits During Read

Fuse Low Byte

 

0

 

 

 

 

0

Extended Fuse Byte 1

DATA

 

 

BS2

 

 

 

 

 

0

 

 

 

 

Lock Bits

 

 

 

 

1

 

 

BS1

Fuse High Byte

 

 

1

 

 

 

 

BS2

30.7.13Reading the Signature Bytes

The algorithm for reading the Signature bytes is as follows (refer to “Programming the Flash” on page 331 for details on Command and Address loading):

1.A: Load Command “0000 1000”.

2.B: Load Address Low Byte (0x00 - 0x02).

3.Set OE to “0”, and BS to “0”. The selected Signature byte can now be read at DATA.

4.Set OE to “1”.

30.7.14Reading the Calibration Byte

The algorithm for reading the Calibration byte is as follows (refer to “Programming the Flash” on page 331 for details on Command and Address loading):

1.A: Load Command “0000 1000”.

2.B: Load Address Low Byte, 0x00.

3.Set OE to “0”, and BS1 to “1”. The Calibration byte can now be read at DATA.

4.Set OE to “1”.

ATmega640/V-1280/V-1281/V-2560/V-2561/V [DATASHEET]

336

2549Q–AVR–02/2014

30.7.15Parallel Programming Characteristics

Figure 30-7. Parallel Programming Timing, Including some General Timing Requirements

 

tXLWL

 

 

XTAL1

tXHXL

 

 

tDVXH

tXLDX

 

 

Data & Contol

 

 

 

(DATA, XA0/1, BS1, BS2)

 

 

 

tBVPH

tPLBX

tBVWL

tWLBX

PAGEL

tPHPL

 

 

 

 

 

 

tWLWH

WR

tPLWL

 

WLRL

 

 

 

RDY/BSY

 

 

 

 

 

 

tWLRH

Figure 30-8. Parallel Programming Timing, Loading Sequence with Timing Requirements(1)

 

LOAD ADDRESS

LOAD DATA

 

LOAD DATA LOAD DATA

LOAD ADDRESS

 

(LOW BYTE)

(LOW BYTE)

(HIGH BYTE)

 

(LOW BYTE)

 

 

 

 

t XLXH

 

 

 

 

tXLPH

tPLXH

 

XTAL1

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

BS1

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

PAGEL

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

DATA

ADDR0 (Low Byte)

DATA (Low Byte)

 

 

DATA (High Byte)

 

 

ADDR1 (Low Byte)

XA0

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

XA1

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Note: 1. The timing requirements shown in Figure 30-7 (that is, tDVXH, tXHXL, and tXLDX) also apply to loading operation.

Figure 30-9. Parallel Programming Timing, Reading Sequence (within the Same Page) with Timing Requirements(1)

 

 

 

 

 

LOAD ADDRESS

READ DATA

 

 

 

READ DATA

 

LOAD ADDRESS

 

 

 

 

 

(LOW BYTE)

(LOW BYTE)

 

 

 

(HIGH BYTE)

 

(LOW BYTE)

 

 

 

 

 

 

tXLOL

 

 

 

 

 

 

 

 

 

 

 

 

XTAL1

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

BS1

 

 

 

 

 

 

 

 

 

 

tBVDV

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

tOLDV

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

OE

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

tOHDZ

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

ADDR1 (Low Byte)

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

DATA

 

ADDR0 (Low Byte)

 

 

DATA (Low Byte)

 

 

 

DATA (High Byte)

 

 

 

 

 

 

 

XA0

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

XA1

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Note:

1. The timing requirements shown in Figure 30-7 (that is, tDVXH, tXHXL, and tXLDX) also apply to reading operation.

ATmega640/V-1280/V-1281/V-2560/V-2561/V [DATASHEET]

337

2549Q–AVR–02/2014