0

I have used your bootloader for ATmega2560-16AU with 16MHz external crystal and it works like a wonder.

In my new project I have a 3V power supply. Therefore, I am planning to use a low frequency external crystal in order to operate the ATmega at a low frequency so that the voltage will be able to go as low as possible.

However, I have a number of issues/questions:

  1. I uploaded the bootloader using an 8MHz external crystal and it went successfully but I am not able to upload a sketch.

  2. Can I run an ATmega2560-16AU with an 8MHz crystal and will it work at 3V, without any risk?

  3. As I do not have an ATmega2560-8AU right now, I am not able to test this. Will your bootloader work with Atmega2560-8AU and an external 8MHz crystal or, before burning bootloader, do I need to make any changes?

Sorry to ask you such a long query, but I have really spent lots of time looking at this and finally today I made a post everywhere.

  • We have 2 optionn. – Som Nov 2 '15 at 12:38
1

Yes, the ATmega328 will run fine at 8MHz, at 3 volts.

The formulas for clock speed vs. volts are:

  • Below 1.8V - cannot operate
  • Below 4 MHz - use at least 1.8V
  • Between 4 MHz and 10 MHz you require: Volts = 1.8 + ((M - 4) * 0.15) (Where M is Megahertz)
  • Between 10 MHz and 20 MHz you require: Volts = 2.7 + ((M - 10) * 0.18) (Where M is Megahertz)
  • You can supply an absolute maximum of 5.5V

Plugging 8MHz into this formula: volts = 1.8+((8-4)*0.15) = 2.4 volts minimum (5.5 volts maximum). Note that, as batteries are used, their voltage goes down gradually, so the 0.6 volts difference will mean that your project will run a little longer.

Since your supply is > 2.7V, we can reverse the second formula: 3V=2.7+(M-10)*0.18); 0.3=(M-10)*0.18; 0.66=M-10, so you can run it at 10.66MHz at 3V (but it is likely to stop as soon as the battery starts to drain).

Your second question, I think, is the most relevant one - the bootloader is written for 16MHz, and some things will not work at other speeds - serial communications used for programming for example. The same, for that matter, applies to the program - if you put in a delay() instruction in your code, it will delay() for twice as long as it should.

You can get around the programming side by ditching the bootloader altogether - once your code is ready, select file->upload using programmer. This will still affect the speed your sketch runs at (anything time-related - serial communications, delay(), etc). To change this, you will need to add a custom entry to the boards.txt file. See [HOWTO:] Anatomy of the boards.txt file for custom boards.

  • Thank for your input. But here I asked regarding ATMega2560 8au with 8MHZ crystal. For whom who is looking for this: forum.arduino.cc/index.php?topic=51955.new#new I have not tried below on but it should work: sparkfun.com/products/10744 Thank. – Som Oct 28 '15 at 7:47
  • Today I just change CPU cycle to 8MHZ and baudrate to 56700 and bootloader works for ATMega2560 8AU with 8Mhz crystal. Just we need to change cpu and baudrate. Thanks. – Som Nov 2 '15 at 12:37
  • 1
    One may be able to overcome the serial baud rate issue just by talking at half the baud rate configured in the bootloader/sketch - that's not fixing it at the source, but can be a pragmatic workaround if the setup to flash the bootloader isn't handy. Of course, the timing functions will remain off by a factor of approximatley two as well. – Chris Stratton Nov 6 '15 at 2:27

Not the answer you're looking for? Browse other questions tagged or ask your own question.