Aveddsafasf

Solo disponible en BuenasTareas
  • Páginas : 6 (1273 palabras )
  • Descarga(s) : 0
  • Publicado : 16 de enero de 2010
Leer documento completo
Vista previa del texto
AUTHOR: AVRFREAKS KEYWORDS: FUSES, LOCK BITS, ISP PROGRAMMING, PARALLELL PROGRAMMING

DESIGN NOTE
#020

This document is originally distributed by AVRfreaks.net, and may be distributed, reproduced, and modified without restrictions. Updates and additional design notes can be found at: www.AVRfreaks.net

Understanding AVR Fuses and Lock bits
Introduction
When programming an AVR device youcan, in addition to programming the Flash and EEPROM memories, program a number of Fuses and Lock bits to enable/disable features and/or different memory protection modes. This document explains the difference between Fuses and Lock bits, and explain the consequence of programming them.

Overview

• • •

Any AVR microcontroller will have two groups of programmable bits: Lock bits and Fuses.The unprogrammed state of a Fuse or a Lock bit is logic "high". Programming any Lock or Fuse bit will change its level to logic "low". The Lock bits and Fuses are not located in the normal flash or EEPROM space, nor are they accessible from the software, except for Lock bits related to the Boot Loader in devices with the Self-Programming feature. Fuses and Lock bits can be accessed in programmingmode, using a Parallell/Serial Programming tool.



Lock Bits

All AVR devices contain two Lock bits named LB1 and LB2. Programming these (“0”) will add protection to the contents written to Flash and EEPROM memories according to Table 1 below. The level of protection is divided in three modes, where mode 1 offers no protection and mode 3 offers maximum protection. It is possible to moveto a higher mode of protection simply by reprogramming the Lock bits. The AVR allows changing "high" bits to "low", but not the other way around. It is not possible to change a "low" Lock bit to a "high", thus lowering the level of protection is not possible. To clear the Lock bits, a complete Chip Erase is required, which erase the Flash memory. Table 1. Memory Lock Bits
Memory Lock Bits Mode 1 23 LB1 1 0 0 LB2 1 1 0 Protection Type Unprogrammed, no protection enabled Further Programming disabled, Read back possible Further programming and read back is disabled

www.AVRfreaks.net

1 Design Note #020 – Date: 05/02

In addition to LB1 and LB2, AVR devices with Self-Programming capabilities will have four additional Lock bits: BLB01, BLB02, BLB11, and BLB12. These bits control therestrictions on the use of the LPM and SPM instructions. For more information on the additional protection modes, please use the applicable datasheet.

Fuses

The Lock bits are available in all programming modes. When it comes to fuses, this is no longer the case. Most fuses are available in all programming modes, but some may only be available in certain modes. Fuse settings are not affected bya Chip Erase. To erase a programmed fuse, you need only program a logic “high” at the correct fuse location. A changed fuse will take effect after the next Power-on Reset. Note that setting Lock mode 2 or higher will disable writing to the fuses. Always program Fuses before setting Lock bits. Table 2 below contains information on which Fuses and Lock bits are available in the different AVRdevices, and which programming mode they are accessible in (see legend below the table). For devices not listed, refer to the data sheet for information.

Table 2. Fuse Bits Availability
Device
AT90S1200 AT90S2313 AT90S/LS2323 AT90S/LS2343 AT90S/LS2333 AT90S/LS4433 AT90S8515 AT90S/LS8535 ATtiny11 ATtiny12 ATtiny15 ATtiny28 ATmega103 ATmega161 ATmega163
RCEN SPIEN RSTDISBL FSTRT BODEN BODLEVEL CKSELn..0 EESAVE SUT n..0 BOOTRST BOOTSZ n..0 INTCAP

P – – P/I – – – – – – – – – – –

P P P P P P P P – H/I
(1)

– – – – – – – – H/I H/I
(2)

– P P/I – – – P P/I H/I – – – – – –

– – – – P/I P/I – – – H/I H/I – – P/I P/I

– – – – P/I P/I – – – H/I H/I – – P/I P/I

– – – – P/I P/I – – H/I H/I H/I P – P/I P/I

– – – – – – – – – – – – P/I – –

– – – – – – – – – – – – P/I – –

– –...
tracking img