Running on 3.7V or less??

I posted a question in Ladyada's site, and it raised more questions that I thought someone here could answer. I want to run a setup on 3.7V, which after time, will obviously dip below that. I now know that using a 16Mhz oscillator will require at least 3.78V to operate correctly. I then decided to go with a 10Mhz or even 8Mhz oscillator and someone brought up a unique thought. This might throw off the delay() and millis() functions because of the timing change from 16 to 10Mhz.

Is there something in the Arduino programming compiler that "assumes" we're using a 16Mhz oscillator and if I change it to 10, will I have problems when running my sketches? What different in the programming environment and is it easily changed to allow 10Mhz oscillator or internal 8Mhz?

Does the Lilypad run at 8Mhz??


the lilypad runs at 8mhz

Thanks a million to both of you. This is exactly what I was looking for. Another thought comes to mind now.

  1. If I am using an aurduino with bootloader already burned on it, it is assuming 16Mhz. If I change it to internal 8Mhz and use 'lilypad' compile option, do I have to remove the 16Mhz from the XTAL1 / XTAL2 pins or can I just leave it with the only consequence being a loss of two pins?

You'll also need to recompile the bootloader with the correct clock speed specified, as the standard bootloaders assume 16 MHz.

  1. Does changing fuse bits or "recompiling" the bootloader require it to be burned back to the chip, becuase I dont have an ICSP programmer right now. The answer to this will dictate whether I go with 8Mhz internal and upload using "lilypad" option, or go with a 10Mhz oscillator and try to make some changes to the board def file.

Thanks again !

You're probably going to need a programmer in any case. To get the microcontroller to run off of the internal (8 MHz) clock, you need to use a programmer to change its fuses. If you use a 10 MHz crystal, the microcontroller should still run, but the bootloader will attempt to communicate at a weird baud rate (19200 * 10 / 16 = 12000) because it thinks it has a 16 MHz clock. To fix that, you need to recompile the bootloader w/ the F_CPU parameter set for 10 MHz, and then burn the bootloader to the board with a programmer.

You might be able to get away with replacing the 16 MHz crystal with an 8 MHz one and then changing the .upload.speed parameter to 9600 in the boards.txt preferences file. If you compile your sketches with the LilyPad compile option, they should run with the correct timings - it's only the bootloader that will be confused.