Go Down

Topic: Oscillator Speed (Read 459 times) previous topic - next topic

voorhies

Hi Everyone,  
  I'm creating a robotics board using an Atmega 1280 with the Arduino libraries, and I'm having some trouble getting the chip to run at full (16Mhz) speed.  I have a 16Mhz crystal just like in the Arduino Mega schematics, though I've switched it out for a surface mount SM49 package.  I'm programming the chip using an AVRISP MKII without a bootloader because once I have my firmware on here, I should rarely need to change it.  

I can successfully program the chip and blink an attached LED, but the program seems to run very slowly: delay(100) causes an actual delay of around 1 second (rather than 100 ms).  This suggests to me that the chip is using the internal oscillator rather than my crystal. Does anyone know how to get the Arduino IDE to burn the proper fuse bits? I get very nervous when it comes to programming fuses - I've only just now come back to using Atmel chips, having bricked too many in the past with bad fuse bits.

The following is the section of my boards.txt file dealing with the board in question. I just copied it from the Arduino Mega section, and modified the name and upload.using fields.

Code: [Select]

nemo.name=NEMO Board

nemo.upload.protocol=stk500
nemo.upload.maximum_size=126976
nemo.upload.speed=57600
nemo.upload.using=avrispmkii

nemo.bootloader.low_fuses=0xFF
nemo.bootloader.high_fuses=0xDA
nemo.bootloader.extended_fuses=0xF5
nemo.bootloader.path=atmega
nemo.bootloader.file=ATmegaBOOT_168_atmega1280.hex
nemo.bootloader.unlock_bits=0x3F
nemo.bootloader.lock_bits=0x0F

nemo.build.mcu=atmega1280
nemo.build.f_cpu=16000000L
nemo.build.core=arduino

voorhies

I suppose the fuse bits aren't getting programmed when I do the normal code upload. Is there a way to just burn the fuses from the Arduino IDE without burning the bootloader as well?

Thanks!

billhowl

Follow this tutorial and using the AVR Studio 4 to change Fuse Settings
http://www.arduino.cc/playground/Learning/Burn168

Go Up