ВУЗ: Не указан

Категория: Не указан

Дисциплина: Не указана

Добавлен: 02.06.2025

Просмотров: 3617

Скачиваний: 0

ВНИМАНИЕ! Если данный файл нарушает Ваши авторские права, то обязательно сообщите нам.

Note: The different BOOTSZ Fuse configurations are shown in Figure 102.

Table 83. Read-While-Write Limit

Section

Pages

Address

Read-While-Write section (RWW)

96

0x000 - 0xBFF

No Read-While-Write section (NRWW)

32

0xC00 - 0xFFF

For details about these two section, see “NRWW – No Read-While-Write Section” on page 207 and “RWW – Read-While-Write Section” on page 207

Table 84. Explanation of Different Variables used in Figure 103 and the Mapping to the

Z-pointer

Corresponding

Variable

Z-value(1)

Description

PCMSB

11

Most significant bit in the Program Counter.

(The Program Counter is 12 bits PC[11:0])

PAGEMSB

4

Most significant bit which is used to address the

words within one page (32 words in a page

requires 5 bits PC [4:0]).

ZPCMSB

Z12

Bit in Z-register that is mapped to PCMSB.

Because Z0 is not used, the ZPCMSB equals

PCMSB + 1.

ZPAGEMSB

Z5

Bit in Z-register that is mapped to PAGEMSB.

Because Z0 is not used, the ZPAGEMSB

equals PAGEMSB + 1.

PCPAGE

PC[11:5]

Z12:Z6

Program counter page address: Page select,

for page erase and page write

PCWORD

PC[4:0]

Z5:Z1

Program counter word address: Word select, for

filling temporary buffer (must be zero during

page write operation)

Note: 1.

Z15:Z13: always ignored

Z0: should be zero for all SPM commands, byte select for the LPM instruction.

See “Addressing the Flash During Self-Programming” on page 211 for details about

the use of Z-pointer during Self-Programming.

218 ATmega8(L)

2486O–AVR–10/04


Memory

Programming

Program And Data

Memory Lock Bits

2486O–AVR–10/04

ATmega8(L)

The ATmega8 provides six Lock Bits which can be left unprogrammed (“1”) or can be programmed (“0”) to obtain the additional features listed in Table 86. The Lock Bits can only be erased to “1” with the Chip Erase command.

Table 85. Lock Bit Byte

Lock Bit Byte

Bit No.

Description

Default Value(1)

7

1 (unprogrammed)

6

1 (unprogrammed)

BLB12

5

Boot lock bit

1 (unprogrammed)

BLB11

4

Boot lock bit

1 (unprogrammed)

BLB02

3

Boot lock bit

1 (unprogrammed)

BLB01

2

Boot lock bit

1 (unprogrammed)

LB2

1

Lock bit

1 (unprogrammed)

LB1

0

Lock bit

1 (unprogrammed)

Note: 1. “1” means unprogrammed, “0” means programmed

Table 86. Lock Bit Protection Modes(2)

Memory Lock Bits

Protection Type

LB Mode

LB2

LB1

1

1

1

No memory lock features enabled.

Further programming of the Flash and EEPROM is

2

1

0

disabled in Parallel and Serial Programming mode. The

Fuse Bits are locked in both Serial and Parallel

Programming mode.(1)

Further programming and verification of the Flash and

3

0

0

EEPROM is disabled in parallel and Serial Programming

mode. The Fuse Bits are locked in both Serial and Parallel

Programming modes.(1)

BLB0 Mode

BLB02

BLB01

1

1

1

No restrictions for SPM or LPM accessing the Application

section.

2

1

0

SPM is not allowed to write to the Application section.

SPM is not allowed to write to the Application section, and

LPM executing from the Boot Loader section is not

3

0

0

allowed to read from the Application section. If Interrupt

Vectors are placed in the Boot Loader section, interrupts

are disabled while executing from the Application section.

LPM executing from the Boot Loader section is not

4

0

1

allowed to read from the Application section. If Interrupt

Vectors are placed in the Boot Loader section, interrupts

are disabled while executing from the Application section.

BLB1 Mode

BLB12

BLB11

219


Table 86. Lock Bit Protection Modes(2) (Continued)

Memory Lock Bits

Protection Type

1

1

1

No restrictions for SPM or LPM accessing the Boot Loader

section.

2

1

0

SPM is not allowed to write to the Boot Loader section.

SPM is not allowed to write to the Boot Loader section,

and LPM executing from the Application section is not

3

0

0

allowed to read from the Boot Loader section. If Interrupt

Vectors are placed in the Application section, interrupts

are disabled while executing from the Boot Loader section.

LPM executing from the Application section is not allowed

4

0

1

to read from the Boot Loader section. If Interrupt Vectors

are placed in the Application section, interrupts are

disabled while executing from the Boot Loader section.

Notes: 1. Program the Fuse Bits before programming the Lock Bits.

2. “1” means unprogrammed, “0” means programmed

Fuse Bits

The ATmega8 has two fuse bytes. Table 87 and Table 88 describe briefly the functional-

ity of all the fuses and how they are mapped into the fuse bytes. Note that the fuses are

read as logical zero, “0”, if they are programmed.

Table 87. Fuse High Byte

Fuse High

Bit

Byte

No.

Description

Default Value

RSTDISBL(4)

7

1

(unprogrammed, PC6 is

Select if PC6 is I/O pin or RESET pin

RESET-pin)

WDTON

6

1

(unprogrammed, WDT

WDT always on

enabled by WDTCR)

SPIEN(1)

5

Enable Serial Program and Data

0

(programmed, SPI prog.

Downloading

enabled)

CKOPT(2)

4

Oscillator options

1

(unprogrammed)

EESAVE

3

EEPROM memory is preserved

1

(unprogrammed,

through the Chip Erase

EEPROM not preserved)

BOOTSZ1

2

Select Boot Size (see Table 82 for

(programmed)(3)

details)

0

BOOTSZ0

1

Select Boot Size (see Table 82 for

(programmed)(3)

details)

0

BOOTRST

0

Select Reset Vector

1

(unprogrammed)

Notes: 1. The SPIEN Fuse is not accessible in Serial Programming mode.

2.The CKOPT Fuse functionality depends on the setting of the CKSEL bits, see “Clock Sources” on page 24 for details.

3.The default value of BOOTSZ1..0 results in maximum Boot Size. See Table 82 on page 217.

4.When programming the RSTDISBL Fuse Parallel Programming has to be used to change fuses or perform further programming.

220 ATmega8(L)

2486O–AVR–10/04


ATmega8(L)

Table 88. Fuse Low Byte

Fuse Low

Bit

Byte

No.

Description

Default Value

BODLEVEL

7

Brown out detector trigger level

1

(unprogrammed)

BODEN

6

Brown out detector enable

1

(unprogrammed, BOD disabled)

SUT1

5

Select start-up time

1

(unprogrammed)(1)

SUT0

4

Select start-up time

0

(programmed)(1)

CKSEL3

3

Select Clock source

0

(programmed)(2)

CKSEL2

2

Select Clock source

0

(programmed)(2)

CKSEL1

1

Select Clock source

0

(programmed)(2)

CKSEL0

0

Select Clock source

1

(unprogrammed)(2)

Notes: 1. The default value of SUT1..0 results in maximum start-up time. SeeTable 10 on page 28 for details.

2.The default setting of CKSEL3..0 results in internal RC Oscillator @ 1MHz. See Table 2 on page 24 for details.

The status of the Fuse Bits is not affected by Chip Erase. Note that the Fuse Bits are locked if lock bit1 (LB1) is programmed. Program the Fuse Bits before programming the Lock Bits.

Latching of Fuses

The fuse values are latched when the device enters Programming mode and changes of

the fuse values will have no effect until the part leaves Programming mode. This does

not apply to the EESAVE Fuse which will take effect once it is programmed. The fuses

are also latched on Power-up in Normal mode.

221

2486O–AVR–10/04