Добавил:
Upload Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
AVR / datasheets / atmega_48_88_168.pdf
Скачиваний:
78
Добавлен:
20.03.2015
Размер:
4.86 Mб
Скачать

5. E: Latch data (give PAGEL a positive pulse).

K:Repeat 3 through 5 until the entire buffer is filled.

L:Program EEPROM page

1.Set BS1 to “0”.

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 27-4 for signal waveforms).

Figure 27-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

27.7.6Reading the Flash

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

1.A: Load Command “0000 0010”.

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 Flash word low byte can now be read at DATA.

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

6.Set OE to “1”.

27.7.7Reading the EEPROM

The algorithm for reading the EEPROM memory is as follows (refer to “Programming the Flash” on page 293 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”.

296 ATmega48/88/168

2545M–AVR–09/07

ATmega48/88/168

27.7.8Programming the Fuse Low Bits

The algorithm for programming the Fuse Low bits is as follows (refer to “Programming the Flash” on page 293 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.

27.7.9Programming the Fuse High Bits

The algorithm for programming the Fuse High bits is as follows (refer to “Programming the Flash” on page 293 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 BS1 to “1” and BS2 to “0”. This selects high data byte.

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

5.Set BS1 to “0”. This selects low data byte.

27.7.10Programming the Extended Fuse Bits

The algorithm for programming the Extended Fuse bits is as follows (refer to “Programming the Flash” on page 293 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 BS1 to “0” and BS2 to “1”. This selects extended data byte.

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

5.5. Set BS2 to “0”. This selects low data byte.

Figure 27-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

27.7.11Programming the Lock Bits

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

297

2545M–AVR–09/07

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.

27.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 293 for details on Command loading):

1.A: Load Command “0000 0100”.

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

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

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

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

6.Set OE to “1”.

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

Fuse Low Byte

 

0

 

0

Extended Fuse Byte 1

DATA

 

BS2

 

 

Lock Bits

 

0

 

 

1

 

 

 

 

BS1

Fuse High Byte

 

 

 

 

1

 

 

 

 

 

BS2

 

 

 

 

 

 

 

 

 

 

 

 

 

27.7.13Reading the Signature Bytes

The algorithm for reading the Signature bytes is as follows (refer to “Programming the Flash” on page 293 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 BS1 to “0”. The selected Signature byte can now be read at DATA.

4.Set OE to “1”.

298 ATmega48/88/168

2545M–AVR–09/07

Соседние файлы в папке datasheets