ATmega328PU fuses question - Page 1
Forum section: electronics / general

author: Chris Wilson
author_rank: Super Contributor
timestamp: December 11, 2014, 03:11:40 pm
content: When I programme a virgin ATmega328PU chip with a firmware from the kit it goes in commercial file pairing the chip seems to "run slow" updates take ages, and when I compare the fuse settings with what they should be, as seen athttp://www.chriswilson.tv/fuses.pdfthese values are not what the chip has stored. The other settings take and are stored correctly. I manually changed the Calibration figures for a blank space again, but the last setting for Calibration has some numbers in it each time, although I set it again as blank. It seems to work OK, is the setting for "Calibration" something that is automatically put in? Do I need to do anything? Thanks. The kit itself is detailed athttp://www.gatesgarth.com/u3.pdfThanks.

author: madires
author_rank: Super Contributor
timestamp: December 11, 2014, 04:39:47 pm
content: The calibration setting is for the internal RC oscillator and is already set by Atmel. There's no need to change it unless you like to re-calibrate the RC oscillator. The default fuse settings for the 328P are:- LFUSE 0x62- HFUSE 0xD9- EFUSE 0xFFThere's a nice online tool athttp://www.engbedded.com/fusecalc/for the fuse settings.

author: westfw
author_rank: Super Contributor
timestamp: December 12, 2014, 12:11:22 am
content: The factory default settings of the fuses on a m328 are to run using the internal 8MHz clock, additionally divided by 8, to yield a final CPU frequency of 1MHz. (This has the advantage of always "working" across the entire voltage range of the chip.) Normally you connect a crystal and set the fuses to (1) use the crystal, and (2) not divide by 8.The "calibration" is to fine-tune the internal clock, so that it would run 8.0 MHz rather than 7.3MHz or 8.1MHz (that's supposed to be the full range of possible calibration.) Improper calibration shouldn't cause the chip to run noticeably slow.

author: paulie
author_rank: Frequent Contributor
timestamp: December 12, 2014, 07:12:32 pm
content: Some values of OSCCAL can have the chip running more than two times faster than others so improper calibration can be very noticeable.

author: Chris Wilson
author_rank: Super Contributor
timestamp: December 13, 2014, 10:42:17 am
content: Thanks paulie!

author: paulie
author_rank: Frequent Contributor
timestamp: December 13, 2014, 12:55:20 pm
content: I think the bottom line is that factory OSCCAL values are OK so no need to play with those. Doing so probably causes more problems than it solves.Fuses on the other hand are very important in order to make the chip work for most applications. The 1mhz factory setting is rarely of much use. Most common is Arduino H=DE L=FF which is easily set by using "burn bootloader" in the IDE. I prefer H=D0 L=E7 which is compatible but has some advantages for me like better POR and preserving EE data. Or L=E2 for running without a crystal.Fuses are dangerous and number one reason people kill their chip so it pays to be careful and double check before "throwing the switch".

author: MickM
author_rank: Regular Contributor
timestamp: December 14, 2014, 12:13:05 pm
content: I built one of these:http://mdiy.pl/atmega-fusebit-doctor-hvpp/?lang=enIt has saved many chips.Mick M

author: paulie
author_rank: Frequent Contributor
timestamp: December 14, 2014, 02:24:06 pm
content: Thanks for that Mick. Just tried and it works like a charm. I've built many fuse fixers over the years and this is by far the best. In fact IMO best hobby project EVER! Schematics and code and the whole design in general very well done. Hex files for several of the most common AVRs, cheapest components, and minimal circuit. One of the best documented projects I've ever seen too. That guy is a humanitarian genius!Much better interface (one button) than Avrdude which is probably the biggest chip killer ever invented. I hate that program but it stupidly rose to the top as a result of popular foolishness. Kinda like MS Windows. LOL.

author: Brutte
author_rank: Frequent Contributor
timestamp: December 14, 2014, 08:07:40 pm
content: Quote from: MickM on December 14, 2014, 12:13:05 pmNo RSTDISBL, no fun!