Hi all,
I am trying to understand if it is enough to change low_fuses from 0xe2 to 0x62 to switch atmega328p from 1Mhz internal oscillator to 8Mhz internal oscillator?
I am using MiniCore to compile binary for custom board, I have no bootloader.
My standard configuration:
I am trying to use OneWireHub to emulate DS18B20 sensor and library told me that
YOUR ARCHITECTURE IS TOO SLOW, THIS MAY RESULT IN TIMING-PROBLEMS
That's why I am trying to use internal 8Mhz clock, cause when I am compiling using this MiniCore settings no warning appears.
Is it enough to compile appropriate firmware and program it using Arduino as ISP?
kosmo_de:
Is it enough to compile appropriate firmware and program it using Arduino as ISP?
No, you must first choose "burn bootloader" if you want to set fuses (or set them manually with AVRDude - and yes, changing lfuse from 0xe2 to 0x62 is all that's needed). This is necessary even if not using a bootloader - for several reasons, involving limitations of the IDE as well as the precedent set by the official core, third party cores do not set the fuses when uploading a sketch via ISP even for boards with no bootloader.
"Burn bootloader/Set Fuses" would be a more accurate name for that menu option, but it would confuse people new to programming (many arduino users) who only know of "fuses" as the thing that blows when something goes wrong, and people new to AVR who know "fuses" as the one-time-programmable e-fuses featured on many processors and used to secure code.
Main parameters for that -u - for turning off security for fuses write (without it requires either read or write 3 times to commit your changes to fuses) and -t - turns terminal mode on.
To find out what parameters are used by arduino IDE to program your controller you can turn on verbose output for compilation and upload; upload your project via IDE and you will see in output log avrdude command executed for upload
use d command to read fuses (could be lfuse, efuse and hfuse)
avrdude> d lfuse
>>> d lfuse
0000 62
from MiniCore boards.txt we can find out what lfuses should be used for 1Mhz internal and for 8Mhz internal settings.
I've found out another - more convenient - option to flash fuses: I just add following to my avrdude command string:
-U lfuse:w:0x62:m
for 1Mhz internal clock
and
-U lfuse:w:0xE2:m
for 8Mhz internal clock
You can also replace lfuse with any other fuse you need to set. You can set multiple fuses just chaining all commands for different fuses as above together
You can just use MiniCore as intended. Select Bootloader: No, choose between 8 MHz internal or 1 MHz internal and hit Burn Bootloader.
No bootloader will be written, but the fuses will be sat correctly according to the options you've selected. The program that's already on the microcontroller will be erased though.
The options that MiniCore provides is there so you don't need to interface with AVRdude directly. Most users find this easier.