Go Down

Topic: Need Help, my ATmega328p is now set at 8Mhz (Internal). (Read 1 time) previous topic - next topic

clausismus

Jul 04, 2012, 06:43 pm Last Edit: Jul 04, 2012, 06:49 pm by clausismus Reason: 1
Hi,

my Brother (I have to say: "My EVIL twin brother" XD) set the clock of my ATmega328p to internal 8Mhz.
He said: "I can set the FUSE-Bits back to 16Mhz."
But he could'nt set it, because there is no 16Mhz item in "AVR Studio 4" for the clock-setting.

We have an UsbTiny board, because of that board, my brother set it to the internal 8Mhz.
I used the board too to program an ATmega8515, to transmit the compiled hex file I used "avrdude".
My brother said, that it maybe possible to set the FUSE-Bits with "avrdude".

I heard about FUSE-Bit since my brother set it to 8Mhz, so I have not knownledge about it.
I don't know the correct parameters for "avrdude" and the correct "FUSE-Bits".
But I have already burned the correct Bootloader (ATmegaBOOT_168_atmega328.hex) on the ATmega328p.
I have an Arduino Duamilinove board.
.
It would be nice, if you could help me a little bit.

clausismus

I don't get it, I found the correct FUSE-Bits for the ATmega328p on this page: http://www.codingwithcody.com/2011/04/arduino-default-fuse-settings/.

Then I inserted my ATmega328p on the "UsbTiny" board and typed these commands:
Code: [Select]

sudo avrdude -c usbtiny -p atmega328p -U flash:w:ATmegaBOOT_168_atmega328.hex -P usb

sudo avrdude -c usbtiny -p m328p -U lfuse:w:0xFF:m -U hfuse:w:0xDA:m -U efuse:w:0x05:m


I got this output message:
Code: [Select]

clausismus@clausismus ~/Arbeitsfläche $ sudo avrdude -c usbtiny -p atmega328p -U flash:w:ATmegaBOOT_168_atmega328.hex -P usb

avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.00s

avrdude: Device signature = 0x1e950f
avrdude: NOTE: FLASH memory has been specified, an erase cycle will be performed
        To disable this feature, specify the -D option.
avrdude: erasing chip
avrdude: reading input file "ATmegaBOOT_168_atmega328.hex"
avrdude: input file ATmegaBOOT_168_atmega328.hex auto detected as Intel Hex
avrdude: writing flash (32670 bytes):

Writing | ################################################## | 100% 52.07s



avrdude: 32670 bytes of flash written
avrdude: verifying flash memory against ATmegaBOOT_168_atmega328.hex:
avrdude: load data flash data from input file ATmegaBOOT_168_atmega328.hex:
avrdude: input file ATmegaBOOT_168_atmega328.hex auto detected as Intel Hex
avrdude: input file ATmegaBOOT_168_atmega328.hex contains 32670 bytes
avrdude: reading on-chip flash data:

Reading | ################################################## | 100% 26.85s



avrdude: verifying ...
avrdude: 32670 bytes of flash verified

avrdude: safemode: Fuses OK

avrdude done.  Thank you.

clausismus@clausismus ~/Arbeitsfläche $ sudo avrdude -c usbtiny -p m328p -U lfuse:w:0xFF:m -U hfuse:w:0xDA:m -U efuse:w:0x05:m

avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.00s

avrdude: Device signature = 0x1e950f
avrdude: reading input file "0xFF"
avrdude: writing lfuse (1 bytes):

Writing | ################################################## | 100% 0.00s

avrdude: 1 bytes of lfuse written
avrdude: verifying lfuse memory against 0xFF:
avrdude: load data lfuse data from input file 0xFF:
avrdude: input file 0xFF contains 1 bytes
avrdude: reading on-chip lfuse data:

Reading | ################################################## | 100% 0.00s

avrdude: verifying ...
avrdude: 1 bytes of lfuse verified
avrdude: reading input file "0xDA"
avrdude: writing hfuse (1 bytes):

Writing | ################################################## | 100% 0.01s

avrdude: 1 bytes of hfuse written
avrdude: verifying hfuse memory against 0xDA:
avrdude: load data hfuse data from input file 0xDA:
avrdude: input file 0xDA contains 1 bytes
avrdude: reading on-chip hfuse data:

Reading | ################################################## | 100% 0.00s

avrdude: verifying ...
avrdude: 1 bytes of hfuse verified
avrdude: reading input file "0x05"
avrdude: writing efuse (1 bytes):

Writing | ################################################## | 100% 0.00s

avrdude: 1 bytes of efuse written
avrdude: verifying efuse memory against 0x05:
avrdude: load data efuse data from input file 0x05:
avrdude: input file 0x05 contains 1 bytes
avrdude: reading on-chip efuse data:

Reading | ################################################## | 100% 0.00s

avrdude: verifying ...
avrdude: 1 bytes of efuse verified

avrdude: safemode: Fuses OK

avrdude done.  Thank you.

clausismus@clausismus ~/Arbeitsfläche $


Then I took the ATmega328p out of the UsbTiny and inserted it to the Arduino Duamilanove.

But now the Arduino board won't be detected by my PC.

Only the LED "L" blinks.

tim7

I think you need avrdude's '-u' option to change fuses, like this:
Code: [Select]

sudo avrdude -c usbtiny -p m328p -u -U lfuse:w:0xFF:m -U hfuse:w:0xDA:m -U efuse:w:0x05:m


James C4S


Then I took the ATmega328p out of the UsbTiny and inserted it to the Arduino Duamilanove.
But now the Arduino board won't be detected by my PC.

The state of the ATmega won't affect the FTDI 232RL's ability to be enumerated by the PC.  Did you remember to install the FTDI drivers?
Capacitor Expert By Day, Enginerd by night.  ||  Personal Blog: www.baldengineer.com  || Electronics Tutorials for Beginners:  www.addohms.com

Go Up