Summary
Updating with the era of technology, the new microcontrollers are coming with lots of inbuilt peripherals and features. These inbuilt peripherals and features not only reduce the cost of additional circuits to be used with the controller but also provide an ease to interface additional devices (such as Modems etc) directly with the microcontroller.
The new generations of microcontrollers are capable of working on internal as well as on external clock option. But then the question comes as to how do we make them work on a desired clock option? How to disable/enable a particular peripheral? As a beginner when you get a new chip (ATmega16/32) you may complain that ‘PORTC of the chip is not working!’ or ‘when the reset pin and 6th pin of PORTC (in ATmega8) are common how shall I select them/distinguish between them?’. These questions may taste bitter when you try to skip them and go ahead, but all these issues can be solved by properly setting the FUSE BITS of your device.
Description
Fuse Bit
|
OCDEN
|
JTAGEN
|
SPIEN
|
CKOPT
|
EESAVE
|
BOOTSZ1
|
BOOTSZ0
|
BOOTRST
|
Bit No.
|
Bit 7
|
Bit 6
|
Bit 5
|
Bit 4
|
Bit 3
|
Bit 2
|
Bit 1
|
Bit 0
|
Default
values
|
1
|
0
|
0
|
1
|
1
|
0
|
0
|
1
|
Fuse Bit
|
BODLEVEL
|
BODEN
|
SUT1
|
SUT0
|
CKSEL3
|
CKSEL2
|
CKSEL1
|
CKSEL0
|
Bit No.
|
Bit 7
|
Bit 6
|
Bit 5
|
Bit 4
|
Bit 3
|
Bit 2
|
Bit 1
|
Bit 0
|
Default values
|
1
|
1
|
1
|
0
|
0
|
0
|
0
|
1
|
The individual fuse bit is explained in next section.
Fuse Bits
Device Clocking Option
|
CKSEL[3:0]
|
External Crystal/Ceramic Resonator
|
1111 – 1010
|
External Low-frequency Crystal
|
1001
|
External RC Oscillator
|
1000 – 0101
|
Calibrated Internal RC Oscillator
|
0100 – 0001
|
External Clock
|
0000
|
The default clock setting for new controller is CKSEL = 0001 (internal RC oscillator 1MHz). Generally, external crystal is used as a clock option (so fuse bit is set between the range 1111-1010).
CKOP
|
CKSEL[3:1]
|
Frequency Range (MHz
|
Recommended Range for Capacitors (pF)
|
1
|
101*
|
0.4 – 0.9
|
–
|
1
|
110
|
0.9 – 3.0
|
12 – 22
|
1
|
111
|
3.0 – 8.0
|
12 – 22
|
0
|
101, 110, 111
|
1.0 -16.0
|
12 – 22
|
Fuse Bits Continued
CKSEL0
|
SUT[1:0]
|
No. of Start-up clocks
|
Additional Delay from Reset
|
Recommended Usage
|
0
|
00
|
258 CK
|
4.1 ms
|
Ceramic resonator, fast rising power
|
0
|
01
|
258 CK
|
65 ms
|
Ceramic resonator, slowly rising power
|
0
|
10
|
1K CK
|
–
|
Ceramic resonator, BOD enabled
|
0
|
11
|
1K CK
|
4.1 ms
|
Ceramic resonator, fast rising power
|
1
|
00
|
1K CK
|
65 ms
|
Ceramic resonator, slowly rising power
|
1
|
01
|
16K CK
|
–
|
Crystal Oscillator, BOD enabled
|
1
|
10
|
16K CK
|
4.1 ms
|
Crystal Oscillator, fast
rising power
|
1
|
11
|
16K CK
|
65 ms
|
Crystal Oscillator, slowly rising power
|
BODEN (Brown-Out Detection Enable)
ATmega16 has a brown-out detection unit which continuously monitors Vcc level with fixed trigger level. This fuse bit is used to enable/disable the brown-out detection unit. To enable the BOD unit, BODEN bit is programmed (0).
BODLEVEL (Brown-Out Detection Level)
Fig. 2: Image showing placement of Bootloader with Main Program
Configuring a New Microcontroller
Fig. 3: Image showing status of Fuse Bits for virgin microcontroller
Fig. 4: Image showing status of Fuse Bits for high external frequency with longest start-up and JTAG disabled
You may also like:
Filed Under: Tutorials
Questions related to this article?
👉Ask and discuss on EDAboard.com and Electro-Tech-Online.com forums.
Tell Us What You Think!!
You must be logged in to post a comment.