Go Down

Topic: Does I need the Bootloader in a new atmega 328 Chip? (Read 1 time) previous topic - next topic

hugo007

Hello friends :)
I had bought 3 atmega chips on ebay to make some tests on breadboard and I want to now if it is mandatory burn the boot-loader on then to work with it.This question is because in the IDe 1.0 there is this option "File -> Upload Using Programmer"
Is this suppose to work without the boot-loader?
Debian,Mint,Ubuntu
Arduino Mega 2560
Arduino Nano
Arduino Duemilanove
MAC OS Montain Lion
Raspberry PI Model B

Osgeld

#1
May 28, 2012, 06:40 pm Last Edit: May 28, 2012, 06:42 pm by Osgeld Reason: 1
if you want to use them IN your arduino then yes, if your hooking them up on a bread board you can use your arduino as a ISP programmer or use a stand alone programmer to upload to the chips

http://arduino.cc/en/Tutorial/ArduinoISP

you will need to set fuses though as stock blank avr chips come clocked to 1Mhz using internal clocking, I do it by hand using avrdude and a command line, or you could fiddle with the boards.txt and make the IDE go though the motions of burning a bootloader which sets the fuses, and not actually upload the bootloader

hugo007

Can you show me the command you use then to set the fuses using avrdude to use an external oscillator?
I want to use then just on breadboard for now, so I'm thinking just set the fuses and program it using a external programmer
Debian,Mint,Ubuntu
Arduino Mega 2560
Arduino Nano
Arduino Duemilanove
MAC OS Montain Lion
Raspberry PI Model B

Osgeld

#3
May 28, 2012, 07:09 pm Last Edit: May 28, 2012, 07:16 pm by Osgeld Reason: 1
Are they 328P's?

you need to find where avr dude is in your system, on windows its in the arduino folder, linux its available pretty much anywhere mac? i dunno

example in windows CMD

Code: [Select]
avrdude -p m328p -c avrisp -P com1 -b 19200 -U lfuse:w:0xff:m -U hfuse:w:0xde:m -U efuse:w:0x05:m

http://www.ladyada.net/make/usbtinyisp/avrdude.html

or you can edit boards.txt, under
Quote
diecimila.name=Arduino Diecimila or Duemilanove w/ ATmega168


remove

Code: [Select]
diecimila.bootloader.file=ATmegaBOOT_168_diecimila.hex
diecimila.bootloader.unlock_bits=0x3F
diecimila.bootloader.lock_bits=0x0F


save, restart arduino and have the IDE burn it

hugo007

Quote
avrdude -p m328p -c avrisp -P com1 -b 19200 -U lfuse:w:0xff:m -U hfuse:w:0xde:m -U efuse:w:0x05:m

After a brief seach I found this site which helps setting the fuses http://www.engbedded.com/fusecalc
I will attach a 16Mhz Cristal on atmega 328p, from what I see in your fuses config the chip will be set to work as 8Mhz right?
Does the Cristal frequency will also be divided? I mean when I connect the 16Mhz cristal what will be the internal clock speed? 8Mhz or 16Mhz?
This is bugging me can you explain me this?
Thanks for great help
Debian,Mint,Ubuntu
Arduino Mega 2560
Arduino Nano
Arduino Duemilanove
MAC OS Montain Lion
Raspberry PI Model B

Osgeld

#5
May 28, 2012, 07:36 pm Last Edit: May 28, 2012, 07:38 pm by Osgeld Reason: 1
nevermind I see what your saying it says 8.0- which really means 8.0 - 20

hugo007

Quote
which really means 8.0 - 20

Sorry I didn't understand ???
Debian,Mint,Ubuntu
Arduino Mega 2560
Arduino Nano
Arduino Duemilanove
MAC OS Montain Lion
Raspberry PI Model B


Go Up