Pages: [1]   Go Down
Author Topic: Advice for Stand-alone Atmega 328 at 3.3V  (Read 1543 times)
0 Members and 1 Guest are viewing this topic.
0
Offline Offline
Newbie
*
Karma: 0
Posts: 2
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I've searched the forum for tips on this topic, but I'd like some advice before I purchase more hardware. Any help is much appreciated.

My current set-up is a stand-alone board with an Atmega328p (preloaded with Arduino bootloader) with 5V power and a 16MHz external crystal. I've loaded a code on the chip to collect and store data from an accelerometer and heart rate monitor to a micro-sd card using an interrupt service routine. To get 3.3V power for these sensors, I've included a voltage regulator on the board. This set-up is working great, but I'd like to make the system portable using a Lithium Polymer battery and reduce my power supply to only 3.3V.

Based on what I have read, I know a 8MHz crystal is needed with a 3.3V supply. What effect will switching the clock speed have on the execution of the code? Specifically, does anyone know if lower the clock speed will impact the interrupt service routines? Is there an easy way to test this using an Arduino development board with the 16MHz crystal?

To switch to the 8MHz crystal and 3.3V set-up, does anyone have a good summary of the steps needed to change the clock speed? Are there any changes to the bootloader?

Thanks!



Logged

SE USA
Offline Offline
Faraday Member
**
Karma: 41
Posts: 3783
@ssh0le
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

you will need a external programmer to set the atmega's fuses to run at 8 mhz

a crystal is not really necessary if your project is not super dependent on accuracy over long periods of time (the chip has a 8mhz oscillator built in)  

and everything will run at half the speed
Logged


0
Offline Offline
Edison Member
*
Karma: 0
Posts: 1103
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
Are there any changes to the bootloader
Yes, you have to switch to a 8MHz bootloader (Lilypad or any 3.3 Volt)

You can use a second Arduino as Programmer (code=ArduinoISP); however it might not work at the first try: Lots of threads from frustrated noobs here in the forum..
Logged

Manchester (England England)
Offline Offline
Brattain Member
*****
Karma: 602
Posts: 33371
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
What effect will switching the clock speed have on the execution of the code?
It makes it slower, half the clock speed and any given piece of code takes twice as long to run. But you knew that didn't you?
Logged

CT, USA
Offline Offline
Sr. Member
****
Karma: 3
Posts: 446
Arduino rocks
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
Based on what I have read, I know a 8MHz crystal is needed with a 3.3V supply.

Have you tried 16MHz with 3.3 V supply? While this is not within the spec, most setups I have used work perfectly even with voltage reduced to 3.3 V.

If it is not a mission critical application, I'd suggest giving that a try first.
Logged

0
Offline Offline
Edison Member
*
Karma: 0
Posts: 1103
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

The theory behind this is, that you need a certain "energy" = V*I/f to switch a transistor. So if f increases either I or V should also increase. As this energy is mainly lost through capacitances, the increase of V is only the second best approach (that is why we have 1.8 volt logic in high performance cores, with VERY high currents flowing!). However "I" is as it is in a given chip, so the supply voltage should be increases with the used clock. However there are no hard limits....
« Last Edit: September 08, 2010, 08:28:50 am by mpeuser » Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 2
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thank you all for your suggestions.

I will try the 16MHz with 3.3V supply first and see if I run into any problems. The device will be taken out into the hot California sun so it will need to make it through that test unscathed.

I'll also try reprogramming with a 8MHz clock and see if my code can still run at a slower speed.

Thanks again.
Logged

Pages: [1]   Go Up
Jump to: