Breadboard Arduino using ATMega8L

i am building a set of arduinos with zigbee modules (MaxStream XBee) to create a network of devices that we'll be used as input device for some art project. i started by implementing the tutorial found at http://mrtof.danslchamp.org/AXIC, but using the ITP Breadboard Arduino found at http://itp.nyu.edu/physcomp/Tutorials/ArduinoBreadboard.

for several reasons, i want to switch to a low power microcontroller, for the moment being the ATMega8L. i have read several thread that refer to this specific microcontroller and mention how to program it with the original Arduino board using 16Mhz by simply changing the preferences.txt for the ide to be compatible.

my first problem, obviously, just changing the preferences.txt doesn't work once i'm using a 8Mhz for my Breadboard Arduino to match the requirements of the ATMega8L.

has anyone done thorough testing using the ATMega8L runnning at 8Mhz? what would be the steps to take to make it work? recompiling the bootloader and/or modifying the libraries?

I have changed clock rates. There are three issues.

  1. You need to change F_CPU in preferences.txt
  2. If you are using the serial bootloader, you need to make a new one with your new clock rate. This will require you to use bootcloner from another Arduino or an ICSP device to set your bootloader.
  3. In 0007 some timing calls will still be wrong, like delayMicroseconds and SoftwareSerial.

Hej,

you have to recompile the bootloader, clone it is not enough. On the other hand, you should not need an external clock, If I remember right, the ATMEGA8L has an internal 8MHz clock already.

/d

thanks that was helpful. everything seems to work find but i've one one remaining question.

does the 'build.f_cpu' in preferences automatically defines the 'f_cpu' and 'cpu_freq' in WConstants.h?

so that there's no need to change them directly in the library when using the IDE?

build.f_cpu automatically sets F_CPU. I'm not sure about CPU_FREQ, but you probably don't need to use it.