avrdude -c <programmer> -p <mcu> -B 100 -P <port> -b <baudrate> -e -U lock:w:0x3F:m -U lfuse:w:0x<lfuse>:m -U hfuse:w:0x<hfuse>:m -U efuse:w:0x<efuse>:m avrdude -c <programmer> -p <mcu> -B 1 -P <port> -b <baudrate> -U flash:w:<hexfile>:i -U lock:w:0x0F:m
how can I do this?
I have just put ATMega328P-AU (brand new - no bootloader, no program) on PCB, added 16 MHz crystal, ISP header and successfully programmed "blink" example it using AVRISP mkII (used Uno and Duemillanove 328 board profiles). To my surprise LED blink frequency was very small. Using stopwatch I came to conclusion that 328 is running at 1 MHz instead of expected 16 Mhz.
avrdude -c usbtiny -p m328p -v
Are you sure it isn't just 8 times slow? There is a divide-by-8 fuse bit.
The solution I use is first burn the standard bootloader, then upload your program (whether or not it uses the bootloader).
avrdude -C ../etc/avrdude.conf -c avrispmkII -P usb -p atmega328p -e -U lfuse:w:0xff:m -U hfuse:w:0xde:m -U efuse:w:0x05:m
Please enter a valid email to subscribe
We need to confirm your email address.
To complete the subscription, please click the link in the
email we just sent you.
Thank you for subscribing!
via Egeo 16