Hi, I am trying to build a project running on LiPo batteries. For this purpose from what I have available, an ATmega using its internal 8MHz oscillator seems to be a good idea (or an ATtiny, but the only thing I have is an ATmega328PU).
ArduinoISP with a Nano@328 is working (with the common setup and a capacitor between RST and GND). When a 16MHz crystal is connected to the ATmega, I can flash it as an Arduino Uno or Mini Pro 3.3V/8MHz bootloader (at least, it says it is successful).
Now, from what I understood, I need to change the fuses (though I have only a vague idea what that is :)) to change to the internal oscillator. In the boards.txt, I copied the entry for the Arduino Mini Pro@8MHz. I entered the fuse values into the calculator http://www.engbedded.com/fusecalc/ and changed it to 8MHz internal oscillator.
I end up with this entry:
pro328.upload.protocol=arduino pro328.upload.maximum_size=30720 pro328.upload.speed=57600 pro328.bootloader.low_fuses=0xFF pro328.bootloader.high_fuses=0xDA pro328.bootloader.extended_fuses=0x05 pro328.bootloader.path=atmega pro328.bootloader.file=ATmegaBOOT_168_atmega328_pro_8MHz.hex pro328.bootloader.unlock_bits=0x3F pro328.bootloader.lock_bits=0x0F pro328.build.mcu=atmega328p pro328.build.f_cpu=8000000L pro328.build.core=arduino pro328.build.variant=standard
When I try to flash this, I get
***failed; avrdude: verification error, first mismatch at byte 0x0000 0x05 != 0xfd avrdude: verification error; content mismatch
Why is that (apart from "Because I don't really know what I am doing") and what can I do?
Additional question: I also have some 8MHz oscillators lying around. So since I can flash the Mini bootloader, this seems to an almost working alternative. Do I use the same capacitors as for the 16MHz crystal? What would be the advantages (more accurate?) and disadvantages (space, power?)?