Добавил:
Upload Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
ATtiny2313A ATtiny4313.pdf
Скачиваний:
41
Добавлен:
11.05.2015
Размер:
6.13 Mб
Скачать

ATtiny2313A/4313

Figure 21-2. Addressing the Flash Which is Organized in Pages

 

PROGRAM

PCMSB

 

 

 

 

PAGEMSB

 

 

 

PCPAGE

PCWORD

 

 

 

 

 

COUNTER

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

PAGE ADDRESS

 

 

WORD ADDRESS

 

 

WITHIN THE FLASH

 

 

WITHIN A PAGE

 

PROGRAM MEMORY

 

 

 

 

 

 

 

 

 

PAGE

PCWORD[PAGEMSB:0]:

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

PAGE

 

 

 

 

 

 

 

 

INSTRUCTION WORD

00

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

01

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

02

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

PAGEEND

Flash programming waveforms are illustrated in Figure 21-3, where XX means “don’t care” and letters refer to the programming steps described earlier.

Figure 21-3. Programming the Flash Waveforms

 

 

 

 

 

 

 

 

F

 

 

 

 

A

B

C

D

E

B

C

D

E

G

H

DATA

0x10

ADDR. LOW

DATA LOW

DATA HIGH

XX

ADDR. LOW

DATA LOW

DATA HIGH

XX

ADDR. HIGH

XX

 

 

 

 

 

 

 

 

 

 

 

XA1

XA0

BS1

XTAL1

WR

RDY/BSY

RESET +12V

OE

PAGEL

BS2

21.2.5Programming the EEPROM

The EEPROM is organized in pages, see Table 21-2 on page 184. When programming the EEPROM, the program data is latched into a page buffer. This allows one page of data to be programmed simultaneously. The programming algorithm for the EEPROM data memory is as follows (see “Programming the Flash” on page 187 for details on loading command, address and data):

A: Load Command “0001 0001”.

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

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

189

8246B–AVR–09/11

C: Load Data (0x00 - 0xFF).

J: Repeat 3 through 4 until the entire buffer is filled.

K: Program EEPROM page

Set BS1 to “0”.

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

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

EEPROM programming waveforms are illustrated in Figure 21-4, where XX means “don’t care” and letters refer to the programming steps described above.

Figure 21-4. EEPROM Programming 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

21.2.6Reading the Flash

The algorithm for reading the Flash memory is as follows (see “Programming the Flash” on page 187 for details on command and address loading):

A: Load Command “0000 0010”.

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

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

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

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

Set OE to “1”.

21.2.7Reading the EEPROM

The algorithm for reading the EEPROM memory is as follows (see “Programming the Flash” on page 187 for details on command and address loading):

A: Load Command “0000 0011”.

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

190 ATtiny2313A/4313

8246B–AVR–09/11

ATtiny2313A/4313

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

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

Set OE to “1”.

21.2.8Programming Low Fuse Bits

The algorithm for programming the low fuse bits is as follows (see “Programming the Flash” on page 187 for details on command and data loading):

A: Load Command “0100 0000”.

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

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

21.2.9Programming High Fuse Bits

The algorithm for programming the high fuse bits is as follows (see “Programming the Flash” on page 187 for details on command and data loading):

A: Load Command “0100 0000”.

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

Set BS1 to “1” and BS2 to “0”. This selects high data byte.

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

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

21.2.10Programming Extended Fuse Bits

The algorithm for programming the extended fuse bits is as follows (see “Programming the Flash” on page 187 for details on command and data loading):

A: Load Command “0100 0000”.

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

Set BS1 to “0” and BS2 to “1”. This selects extended data byte.

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

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

Fuse programming waveforms are illustrated in Figure 21-5, where XX means “don’t care” and letters refer to the programming steps described above.

191

8246B–AVR–09/11

Figure 21-5. Fuses Programming 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

21.2.11Programming the Lock Bits

The algorithm for programming the lock bits is as follows (see “Programming the Flash” on page 187 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.

21.2.12Reading Fuse and Lock Bits

The algorithm for reading fuse and lock bits is as follows (see “Programming the Flash” on page 187 for details on command loading):

A: Load Command “0000 0100”.

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

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

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

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

Set OE to “1”.

Fuse and lock bit mapping is illustrated in Figure 21-6, below.

192 ATtiny2313A/4313

8246B–AVR–09/11

Соседние файлы в предмете [НЕСОРТИРОВАННОЕ]