ATmega16A

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

26.7.5Reading the Flash

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

1.A: Load Command “0000 0010”.

2.G: Load Address High Byte ($00 - $FF)

3.B: Load Address Low Byte ($00 - $FF)

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”.

26.7.6Reading the EEPROM

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

1.A: Load Command “0000 0011”.

2.G: Load Address High Byte ($00 - $FF)

3.B: Load Address Low Byte ($00 - $FF)

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

5.Set OE to “1”.

26.7.7Programming the Fuse Low Bits

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

273

8154A–AVR–06/08

3.Set BS1 to “0” and BS2 to “0”.

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

26.7.8Programming the Fuse High Bits

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

Figure 26-5. Programming the Fuses

 

 

 

Write Fuse Low byte

 

 

Write Fuse high byte

 

A

C

 

A

C

 

DATA

$40

DATA

XX

$40

DATA

XX

 

 

 

 

 

 

XA1

XA0

BS1

BS2

XTAL1

WR

RDY/BSY

RESET +12V

OE

PAGEL

26.7.9Programming the Lock Bits

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

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.

26.7.10Reading the Fuse and Lock Bits

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

274 ATmega16A

8154A–AVR–06/08

ATmega16A

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 “0” and BS1 to “1”. The status of the Lock bits can now be read at DATA (“0” means programmed).

5.Set OE to “1”.

Figure 26-6. Mapping between BS1, BS2 and the Fuseand Lock Bits during Read

Fuse Low Byte 0

DATA

Lock Bits

 

0

 

1

BS1

Fuse High Byte 1

BS2

26.7.11Reading the Signature Bytes

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

1.A: Load Command “0000 1000”.

2.B: Load Address Low Byte ($00 - $02).

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

4.Set OE to “1”.

26.7.12Reading the Calibration Byte

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

1.A: Load Command “0000 1000”.

2.B: Load Address Low Byte, $00.

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

4.Set OE to “1”.

275

8154A–AVR–06/08

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