AVR microcontroller fuse position problem

Publisher:大伊山人Latest update time:2013-01-10 Source: 21IC Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

Beginners often don't understand fuses. AVR chips use fuses to set the clock, boot time, enable some functions, BOOT area settings, and of course the most troublesome bit for beginners. If you don't set it well, it will be very troublesome to lock the chip. If you want to minimize the power consumption of the MCU, you also need to understand the settings of some bits.

1: Not programmed

0: Programming

1.BOD (Brown-out Detection) power failure detection circuit

BODLEVEL (BOD level selection): 1: 2.7V level; 0: 4.0V level

BODEN (BOD function control): 1: BOD function disabled; 0: BOD function enabled

Usage: If BODEN is enabled (checkbox is selected) to start the power-off detection, the detection level is determined by BODLEVEL. Once VCC drops below the trigger level (2.7v or 4.0v), the MCU is reset; when the VCC level is greater than the trigger level, it will restart after tTOUT delay cycle.

Because M16L can work at 2.7v~5.5v, the trigger level can be selected as 2.7v (BODLEVEL=1) or 4.0v (BODLEVEL=0); while M16 works at 4.5~5.5V, so only BODLEVEL=0 can be selected, BODLEVEL=1 is not applicable to ATmega16.

2. Reset start time selection

SUT 1/0: When different crystal oscillators are selected, the SUT is different.

If there is no special requirement, it is recommended to set the reset startup time of SUT 1/0 to be slightly longer so that the power supply can rise slowly.

3.CKSEL3/0: Clock source selection (clock table)

Clock table

Clock source start-up delay fuse

External clock 6 CK + 0 ms CKSEL=0000 SUT="00"

External clock 6 CK + 4.1 ms CKSEL=0000 SUT="01"

External clock 6 CK + 65 ms CKSEL="0000" SUT="10"

Internal RC oscillator

1MHZ 6 CK + 0 ms CKSEL="0001" SUT="00"

Internal RC oscillation 1MHZ 6 CK + 4.1 ms CKSEL="0001" SUT="01"

Internal RC oscillator 1MHZ1 6 CK + 65 ms CKSEL="0001" SUT="10"

Internal RC oscillation 2MHZ 6 CK + 0 ms CKSEL="0010" SUT="00"

Internal RC oscillator

2MHZ 6CK + 4.1ms CKSEL="0010" SUT="01"

Internal RC oscillation 2MHZ 6 CK + 65 ms CKSEL="0010" SUT="10"

Internal RC oscillator 4MHZ 6 CK + 0 ms CKSEL="0011" SUT="00"

Internal RC oscillator 4MHZ 6 CK + 4.1 ms CKSEL="0011" SUT="01"

Internal RC oscillator 4MHZ 6 CK + 65 ms CKSEL="0011" SUT="10"

Internal RC oscillator 8MHZ 6 CK + 0 ms CKSEL="0100" SUT="00"

Internal RC oscillator 8MHZ 6 CK + 4.1 ms CKSEL="0100" SUT="01"

Internal RC oscillator 8MHZ 6 CK + 65 ms CKSEL="0100" SUT="10"

External RC oscillation ≤ 0.9MHZ 18 CK + 0 ms CKSEL="0101" SUT="00"

External RC oscillation ≤ 0.9MHZ 18 CK + 4.1 ms CKSEL="0101" SUT="01"

External RC oscillation ≤ 0.9MHZ 18 CK + 65 ms CKSEL="0101" SUT="10"

External RC oscillation ≤ 0.9MHZ 6 CK + 4.1 ms CKSEL="0101" SUT="11"

External RC oscillator 0.9-3.0MHZ 18 CK + 0 ms CKSEL="0110" SUT="00"

External RC oscillator 0.9-3.0MHZ 18 CK + 4.1 ms CKSEL="0110" SUT="01"

External RC oscillator 0.9-3.0MHZ 18 CK + 65 ms CKSEL="0110" SUT="10"

External RC oscillator 0.9-3.0MHZ 6 CK + 4.1 ms CKSEL=0110 SUT="11"

External RC oscillator 3.0-8.0MHZ 18 CK + 0 ms CKSEL=0111 SUT="00"

External RC oscillator 3.0-8.0MHZ 18 CK + 4.1 ms CKSEL="0111" SUT="01"

External RC oscillator 3.0-8.0MHZ 18 CK + 65 ms CKSEL=0111 SUT="10"

External RC oscillator 3.0-8.0MHZ 6 CK + 4.1 ms CKSEL="0111" SUT="11"

External RC oscillator 8.0-12.0MHZ 18 CK + 0 ms CKSEL=1000 SUT="00"

External RC oscillator 8.0-12.0MHZ 18 CK + 4.1 ms CKSEL="1000" SUT="01"

External RC oscillator 8.0-12.0MHZ 18 CK + 65 ms CKSEL="1000" SUT="10"

External RC oscillator 8.0-12.0MHZ 6 CK + 4.1 ms CKSEL="1000" SUT="11"

Low frequency crystal oscillator (32.768KHZ) 1K CK + 4.1 ms CKSEL="1001" SUT="00"

Low frequency crystal oscillator (32.768KHZ) 1K CK + 65 ms CKSEL="1001" SUT="01"

Low frequency crystal oscillator (32.768KHZ) 32K CK + 65 ms CKSEL="1001" SUT="10"

Low frequency quartz/ceramic oscillator (0.4-0.9MHZ) 258 CK + 4.1 ms CKSEL="1010" SUT="00"

Low frequency quartz/ceramic oscillator (0.4-0.9MHZ) 258 CK + 65 ms CKSEL="1010" SUT="01"

Low frequency quartz/ceramic oscillator (0.4-0.9MHZ) 1K CK + 0 ms CKSEL=1010 SUT="10"

Low frequency quartz/ceramic oscillator (0.4-0.9MHZ) 1K CK + 4.1 ms CKSEL="1010" SUT="11"

Low frequency quartz/ceramic oscillator (0.4-0.9MHZ) 1K CK + 65 ms CKSEL="1011" SUT="00"

Low frequency quartz/ceramic oscillator (0.4-0.9MHZ) 16K CK + 0 ms CKSEL=1011 SUT="01"[page]

Low frequency quartz/ceramic oscillator (0.4-0.9MHZ) 16K CK + 4.1ms CKSEL="1011" SUT="10"

Low frequency quartz/ceramic oscillator (0.4-0.9MHZ) 16K CK + 65ms CKSEL="1011" SUT="11"

IF Quartz/Ceramic Oscillator (0.9-3.0MHZ) 258 CK + 4.1 ms CKSEL="1100" SUT="00"

IF Quartz/Ceramic Oscillator (0.9-3.0MHZ) 258 CK + 65 ms CKSEL="1100" SUT="01"

IF quartz/ceramic oscillator (0.9-3.0MHZ) 1K CK + 0 ms CKSEL=1100 SUT="10"

IF Quartz/Ceramic Oscillator (0.9-3.0MHZ) 1K CK + 4.1 ms CKSEL="1100" SUT="11"

IF Quartz/Ceramic Oscillator (0.9-3.0MHZ) 1K CK + 65 ms CKSEL="1101" SUT="00"

IF Quartz/Ceramic Oscillator (0.9-3.0MHZ) 16K CK + 0 ms CKSEL="1101" SUT="01"

IF Quartz/Ceramic Oscillator (0.9-3.0MHZ) 16K CK + 4.1ms CKSEL="1101" SUT="10"

IF Quartz/Ceramic Oscillator (0.9-3.0MHZ) 16K CK + 65ms CKSEL="1101" SUT="11"

High frequency quartz/ceramic oscillator (3.0-8.0MHZ) 258 CK + 4.1 ms CKSEL="111"0 SUT="00"

High frequency quartz/ceramic oscillator (3.0-8.0MHZ) 258 CK + 65 ms CKSEL="111"0 SUT="01"

High frequency quartz/ceramic oscillator (3.0-8.0MHZ) 1K CK + 0 ms CKSEL="111"0 SUT="10"

High frequency quartz/ceramic oscillator (3.0-8.0MHZ) 1K CK + 4.1 ms CKSEL="111"0 SUT="11"

High frequency quartz/ceramic oscillator (3.0-8.0MHZ) 1K CK + 65 ms CKSEL="1111" SUT="00"

High frequency quartz/ceramic oscillator (3.0-8.0MHZ) 16K CK + 0 ms CKSEL="1111" SUT="01"

High frequency quartz/ceramic oscillator (3.0-8.0MHZ) 16K CK + 4.1ms CKSEL="111"1 SUT="10"

High frequency quartz/ceramic oscillator (3.0-8.0MHZ) 16K CK + 65ms CKSEL="1111" SUT="11"

High position (BOOT area settings):

1. JTAGEN (JTAG enable): 1: JTAG disabled; 0: JTAG enabled

OCDEN (OCD function enable): 1: OCD function disabled; 0: OCD function enabled

Note: OCDEN (On-chip Debug): On-chip debug enable bit

JTAGEN (JTAG Enable): JTAG test access port

How to use: During JTAG debugging, enable OCDEN JTAGEN (check the box) and keep all lock bits in the unlocked state; in actual use, to reduce power consumption, do not enable OCDEN JTAGEN, which reduces the current by about 2-3mA.

2. SPIEN (SPI download enable): 1: SPI download disabled; 0: SPI download enabled

Note: In the ISP software, SPIEN cannot be edited and defaults to 0.

3. CKOPT (select amplifier mode): CKOPT=0: high amplitude oscillation output; CKOPT

=1: Low amplitude oscillation output

When CKOPT is programmed, the oscillator generates full amplitude oscillation at the output pin. This mode is suitable for noisy environments and situations where a second clock buffer needs to be driven through XTAL2, and the frequency range of this mode is relatively wide. When CKOPT is kept unprogrammed, the output signal amplitude of the oscillator is relatively small. Its advantage is that the power consumption is greatly reduced, but the frequency range is relatively narrow and it cannot drive other clock buffers.

For the resonator, the maximum frequency is 8 MHz when CKOPT is not programmed and 16 MHz when CKOPT is programmed. CKOPT is not programmed when the internal RC oscillator is operating.

4.EEAVE (EEPROM data retention during burning): 1: not retained; 0: retained

5.BOOTRST (reset entry selection): 1: program starts from address 0x0000 0: after reset

Execute from the BOOT area (refer to BOOTSZ0/1)

6.BOOTSZ 1/0 (boot area program size and entry):

00: 1024Word/0xc00;

01: 512Word/0xe00;

10: 256Word/0xf00;

11: 128Word/0xf80

Reference address:AVR microcontroller fuse position problem

Previous article:Which compiler is better for AVR microcontroller
Next article:AVR MCU TC0 fast PWM

Latest Microcontroller Articles
  • Download from the Internet--ARM Getting Started Notes
    A brief introduction: From today on, the ARM notebook of the rookie is open, and it can be regarded as a place to store these notes. Why publish it? Maybe you are interested in it. In fact, the reason for these notes is ...
  • Learn ARM development(22)
    Turning off and on interrupts Interrupts are an efficient dialogue mechanism, but sometimes you don't want to interrupt the program while it is running. For example, when you are printing something, the program suddenly interrupts and another ...
  • Learn ARM development(21)
    First, declare the task pointer, because it will be used later. Task pointer volatile TASK_TCB* volatile g_pCurrentTask = NULL;volatile TASK_TCB* vol ...
  • Learn ARM development(20)
    With the previous Tick interrupt, the basic task switching conditions are ready. However, this "easterly" is also difficult to understand. Only through continuous practice can we understand it. ...
  • Learn ARM development(19)
    After many days of hard work, I finally got the interrupt working. But in order to allow RTOS to use timer interrupts, what kind of interrupts can be implemented in S3C44B0? There are two methods in S3C44B0. ...
  • Learn ARM development(14)
  • Learn ARM development(15)
  • Learn ARM development(16)
  • Learn ARM development(17)
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号