Loading...
  Show Posts
Pages: [1] 2 3 ... 25
1  Using Arduino / Microcontrollers / Re: Moving to something smaller on: May 13, 2013, 07:44:32 pm
Sparkfun make a "Mega Pro Mini" board. It's based on the same chip as the Mega2560, so you wouldn't need to alter your code. Potential disadvantages are that it runs at 8MHz and 3.3V instead of the usual 16MHz and 5V. It also uses unusual connectors, and needs an FTDI adapter to program.

A number of people have made Arduinos based on the ATmega1284 chip which might be ideal for your application, but I don't know how you'd obtain one of these boards. The 1284 chip is available in a DIL package, so you could make your own on stripboard.
2  Using Arduino / Microcontrollers / Re: Unable to run this code on arduino uno. on: May 12, 2013, 01:48:05 pm
Quote
Code:
#define MAX_CAPTURE 584  // Line number 1
uint32_t now, start, capture[MAX_CAPTURE];

584 * 4 = 2.3 k-bytes RAM.
3  Using Arduino / Microcontrollers / Re: Atmega328p Power Saving Techniques on: April 25, 2013, 12:01:39 pm
The "power_all_disable()" does that.

Are you sure?  The datasheet makes a point of saying that the ADC must be disabled (ADCSRA) before being shutdown (PRR).  You commented that disabling the ADC doesn't seem to do anything, but it should make a noticeable difference.
4  Using Arduino / Microcontrollers / Re: Atmega328p Power Saving Techniques on: April 25, 2013, 11:04:45 am
Are you sure the watchdog is being set correctly?  Normally you need to set WDCE before changing WDE or the prescaler bits.

BTW, after the watchdog interrupt WDIF is cleared automatically (so you don't need to do it in the ISR).  Meanwhile the WDT is still running, and may reset the processor before the 4s delay finishes (not that it matters much in this case).

I also noticed that you're not switching the ADC off after disabling it (power reduction register, PRR).
5  Using Arduino / Microcontrollers / Re: UNO upgrade to crystal oscillator on: April 25, 2013, 01:53:33 am
A little while ago I compared the clock accuracy of an Uno with a Freetronics Eleven (Uno clone with a crystal).  The crystal was 47x more accurate and 35x more stable.  That's still not really good enough for long term timekeeping, but for applications such as interval timing and event-rate measurement it's a lot better than a ceramic resonator.

http://arduino.cc/forum/index.php/topic,69316.15.html
6  Using Arduino / Microcontrollers / Re: ATmega328P targeted at low-power battery use: help needed with baby steps! on: April 17, 2013, 11:36:43 am
If you have the Arduino IDE running then you already have everything you need (I'm less sure about Macs, but I think this is true).  Just get the half-dozen-or-so files that make up the bootloader source code and put them in a directory in .../hardware/arduino/bootloaders/.
7  Using Arduino / Microcontrollers / Re: ATmega328P targeted at low-power battery use: help needed with baby steps! on: April 17, 2013, 08:51:05 am
Thanks for letting us know it worked.  Quite right about the fuses, I forgot they'd need alteration.  BTW Optiboot is maintained by WestfW at http://code.google.com/p/optiboot/, and he's made the code very easy to compile using the tools already included in the Arduino IDE.
8  Using Arduino / Microcontrollers / Re: ATmega328P targeted at low-power battery use: help needed with baby steps! on: April 16, 2013, 03:47:47 pm
Anyone got a precompiled 1MHz-friendly ATmega328P bootloader.hex file?

Here you go.  They're untested I'm afraid, but I'm using Optiboot on other boards at non-standard frequencies and baud-rates with no problems.

atmega328_1a.hex (Optiboot for 9600baud at 1MHz)
Code:
:107E0000112484B714BE81FFE6D085E08093810001
:107E100082E08093C00088E18093C10086E0809377
:107E2000C2008CE08093C4008EE0BFD0259A86E02B
:107E300023EC3FEF91E0309385002093840096BBC4
:107E4000B09BFECF1D9AA8958150A9F7EE24FF2480
:107E5000AA24A394B5E0CB2EA1E1BA2EF3E0DF2E45
:107E600098D0813461F495D0082FA5D0023829F13B
:107E7000013811F485E001C083E083D07FC08234F3
:107E800011F484E103C0853419F485E09CD076C0F8
:107E9000853579F47ED0E82EFF247BD0082F10E0C2
:107EA000102F00270E291F29000F111F84D07801E1
:107EB00065C0863521F484E086D080E0DECF84364C
:107EC00009F040C066D065D0082F63D080E0E81686
:107ED00080E7F80618F4F701D7BEE895C0E0D1E0D6
:107EE00058D089930C17E1F7F0E0EF16F0E7FF06A2
:107EF00018F0F701D7BEE8955ED007B600FCFDCFBD
:107F0000A701A0E0B1E02C9130E011968C9111977F
:107F100090E0982F8827822B932B1296FA010C0160
:107F2000A7BEE89511244E5F5F4FF1E0A038BF0770
:107F300051F7F701C7BEE89507B600FCFDCFB7BE05
:107F4000E8951CC0843761F424D023D0082F21D0B9
:107F500032D0F70185917F0114D00150D1F70EC0C6
:107F6000853739F428D08EE10CD085E90AD08FE02E
:107F700084CF813511F488E018D01DD080E101D084
:107F80006FCF982F8091C00085FFFCCF9093C600E3
:107F900008958091C00087FFFCCF8091C00084FDD0
:107FA00001C0A8958091C6000895E0E6F0E098E150
:107FB000908380830895EDDF803219F088E0F5DF4B
:107FC000FFCF84E1DECF1F93182FE3DF1150E9F7D5
:107FD000F2DF1F910895282E80E0E7DFEE27FF27CC
:027FE000099402
:027FFE0000057C
:0400000300007E007B
:00000001FF

atmega328_1b.hex (Optiboot for 4800baud at 1MHz)
Code:
:107E0000112484B714BE81FFE6D085E08093810001
:107E100082E08093C00088E18093C10086E0809377
:107E2000C20089E18093C4008EE0BFD0259A86E02D
:107E300023EC3FEF91E0309385002093840096BBC4
:107E4000B09BFECF1D9AA8958150A9F7EE24FF2480
:107E5000AA24A394B5E0CB2EA1E1BA2EF3E0DF2E45
:107E600098D0813461F495D0082FA5D0023829F13B
:107E7000013811F485E001C083E083D07FC08234F3
:107E800011F484E103C0853419F485E09CD076C0F8
:107E9000853579F47ED0E82EFF247BD0082F10E0C2
:107EA000102F00270E291F29000F111F84D07801E1
:107EB00065C0863521F484E086D080E0DECF84364C
:107EC00009F040C066D065D0082F63D080E0E81686
:107ED00080E7F80618F4F701D7BEE895C0E0D1E0D6
:107EE00058D089930C17E1F7F0E0EF16F0E7FF06A2
:107EF00018F0F701D7BEE8955ED007B600FCFDCFBD
:107F0000A701A0E0B1E02C9130E011968C9111977F
:107F100090E0982F8827822B932B1296FA010C0160
:107F2000A7BEE89511244E5F5F4FF1E0A038BF0770
:107F300051F7F701C7BEE89507B600FCFDCFB7BE05
:107F4000E8951CC0843761F424D023D0082F21D0B9
:107F500032D0F70185917F0114D00150D1F70EC0C6
:107F6000853739F428D08EE10CD085E90AD08FE02E
:107F700084CF813511F488E018D01DD080E101D084
:107F80006FCF982F8091C00085FFFCCF9093C600E3
:107F900008958091C00087FFFCCF8091C00084FDD0
:107FA00001C0A8958091C6000895E0E6F0E098E150
:107FB000908380830895EDDF803219F088E0F5DF4B
:107FC000FFCF84E1DECF1F93182FE3DF1150E9F7D5
:107FD000F2DF1F910895282E80E0E7DFEE27FF27CC
:027FE000099402
:027FFE0000057C
:0400000300007E007B
:00000001FF

boards.txt entries:
Code:
atmega328_1mhz_9600baud.name=Optiboot 1MHz 9600baud
atmega328_1mhz_9600baud.upload.protocol=arduino
atmega328_1mhz_9600baud.upload.maximum_size=32256
atmega328_1mhz_9600baud.upload.speed=9600
atmega328_1mhz_9600baud.bootloader.low_fuses=0xff
atmega328_1mhz_9600baud.bootloader.high_fuses=0xde
atmega328_1mhz_9600baud.bootloader.extended_fuses=0x05
atmega328_1mhz_9600baud.bootloader.path=optiboot_v50
atmega328_1mhz_9600baud.bootloader.file=atmega328_1a.hex
atmega328_1mhz_9600baud.bootloader.unlock_bits=0x3F
atmega328_1mhz_9600baud.bootloader.lock_bits=0x2F
atmega328_1mhz_9600baud.build.mcu=atmega328p
atmega328_1mhz_9600baud.build.f_cpu=1000000L
atmega328_1mhz_9600baud.build.core=arduino
atmega328_1mhz_9600baud.build.variant=standard

atmega328_1mhz_4800baud.name=Optiboot 1MHz 4800baud
atmega328_1mhz_4800baud.upload.protocol=arduino
atmega328_1mhz_4800baud.upload.maximum_size=32256
atmega328_1mhz_4800baud.upload.speed=4800
atmega328_1mhz_4800baud.bootloader.low_fuses=0xff
atmega328_1mhz_4800baud.bootloader.high_fuses=0xde
atmega328_1mhz_4800baud.bootloader.extended_fuses=0x05
atmega328_1mhz_4800baud.bootloader.path=optiboot_v50
atmega328_1mhz_4800baud.bootloader.file=atmega328_1b.hex
atmega328_1mhz_4800baud.bootloader.unlock_bits=0x3F
atmega328_1mhz_4800baud.bootloader.lock_bits=0x2F
atmega328_1mhz_4800baud.build.mcu=atmega328p
atmega328_1mhz_4800baud.build.f_cpu=1000000L
atmega328_1mhz_4800baud.build.core=arduino
atmega328_1mhz_4800baud.build.variant=standard
9  Using Arduino / Microcontrollers / Re: Arduino Leo compared to a computer. on: April 10, 2013, 09:35:36 am
In terms of home computers I guess you could compare the Leonardo to the 6502 or Z80 based computers which appeared in the early 80s, such as the BBC Micro (1981) or Sinclair Spectrum (1982).  Although they usually had more RAM, commonly 16-64k, that memory also had to contain the program (and the video memory).  The OS was in ROM, so did not use up much RAM.  So the overall memory constrains were similar.  They were a good bit slower than an Arduino though, running at 2-4 MHz.  'C' compilers were not readily available so most of use used Basic (which was slow to run) and Assembler (which was slow to write).

In cost they were absolutely not comparable to an Arduino.  Even the Spectrum, one of the cheaper home computers of the time, was well over a hundred pounds.  Computers with user-accessible IO and ADCs were considerably more.  In fact I can't think of any programmable computing device which has ever been cheaper than an Arduino...
10  Using Arduino / Microcontrollers / Re: Question on difference between bootloaders? on: April 09, 2013, 02:36:58 pm
"Flashing a chip" and "running a bootloader" are two different instances. You may flash a chip with "any recommended crystal value" connected to it, afaik (provided you are using a standard programming method).

The processor must be running, so the set fuse values must correspond to the crystal used during programming.  Is so happens that the fuse values for 8MHz and 16MHz are the same, so in this case we can ignore the fact that we're using the "wrong" clock during programming.
11  Using Arduino / Microcontrollers / Re: Question on difference between bootloaders? on: April 09, 2013, 02:26:39 pm
correct?
Spot on. :-)

I flash Duemilanove with the Arduino as ISP sketch..  ...wire up board..
make sure com port is right...  choose - Arduino Pro/Pro-Mini @+3.3v & 8MHz entry from BOARDS menu..
and then choose BURN BOOTLOADER..

This will also work.  However you'll need to remove your chip from the 16MHz jig and install it in the 8MHz circuit before you can test it (or create yet another new entry in boards.txt).
12  Using Arduino / Microcontrollers / Re: Question on difference between bootloaders? on: April 09, 2013, 02:15:55 pm
Quote
that being said.. 'is' moving toward +3.3v based boards the trend? (future?)..
Yes.

Oo-er.  That's perhaps overstating it.  Fast processors have used lower voltages for many years, and even 3.3V is rather high for a modern chip.

But 5V still has plenty of advantages in an Arduino.  Minimalist boards based on the 32U4 chip can run off 5V USB power without a regulator.  Many components require 5V or run better at 5V: audio amplifiers, buzzers, large LED displays, power transistors, relays...
13  Using Arduino / Microcontrollers / Re: Question on difference between bootloaders? on: April 09, 2013, 01:59:57 pm
I have what I believe to be a FLASHED chip with Optiboot on it.   Since it 'auto detects' the chip signature.. and there is no 8Mhz version.. (and you cant choose anyways.. Optiloader just 'goes'..and runs when a chip is detected)... this chip is set-up to use 16Mhz.


which Im assuming will NOT work in the final/target board that is set up with an 8MHz external resonator..

It will work.  Trust me.  The bootloader will run at half the normal speed, but that's just fine.  Once the bootloader has finished running it passes control to your sketch, which will run at the speed you expect just the same as on any other 8MHz board.

You could recompile Optiboot for an 8MHz processor.  You will find (I've tried it) that at 8MHz the "normal" baud rate of 115200 is unreliable, so you'll need to slow it down to 57600.  But now the 8MHz version of Optiboot is (aside from some very minor cosmetic issues) exactly the same as the 16MHz version.  The instructions to communicate at 115200 baud, if carried out at half speed, correspond precisely to 57600 baud.

The only problem you have is that there is no standard Arduino which uses Optiboot at 8MHz, and that means that you cannot use one of the existing definitions in boards.txt.  But that's very easily overcome, as described above.  If you really really do not want to alter boards.txt, then you'll need to start over (although the 16MHz jig will still be ok).
14  Using Arduino / Microcontrollers / Re: Question on difference between bootloaders? on: April 09, 2013, 01:28:50 pm
1.) because I successfully flashed Optiboot (using the Otiloader sketch.. that auto detects chip signature) in a jig/circuit that was set-up with 16MHz external crystal,..... I can just take that chip out.. and pop it into the 'final' circuit that is set-up to use an 8MHz external resonator.. and have ZERO problems? side effects?......nothing??

That's right.  The only extra thing you'll have to do is add an extra entry in boards.txt.  You have installed an Optiboot binary which is made for running at 16MHz.  It will still run at 8MHz, but at half the speed.  The only change you have to make is ensure that the communications coming from your PC are also running at half the normal speed.

Quote
2.) There is no 'pre-existing' entry in the boards menu in the Arduino IDE for ANYTHING Optiboot related?  16Mhz or 8Mhz??

No, that's not right.  The Uno, the Arduino Mini, and the Arduino Ethernet all use Optiboot at 16MHz.

Quote
now this seems like an answer to addresses my current situation/problem...(correct?)

I'm not quite sure that your current problem is.  If you've got Optiboot running, isn't that enough?
15  Using Arduino / Microcontrollers / Re: Question on difference between bootloaders? on: April 09, 2013, 12:35:37 pm
If you have Optiboot running properly at 16MHz then you can run it at 8MHz with no modifications.  There is no pre-existing definition in the Arduino IDE for a board with Optiboot at 8MHz, but it's easy to add one:  Find the boards.txt file and duplicate the uno definition (the first block of text).  Change the uno prefix in the duplicated text to something else, change upload.speed to 57600, change f_cpu to 8000000L, and change name to something else.

Likewise you can burn a bootloader binary made for an 8MHz board onto a chip running at 16MHz.  To test it with the 16MHz crystal you just need to upload at twice the normal baud, and to do that you make a new entry in boards.txt as described above.

ATmegaBOOT supports EEPROM.
Cool.  I didn't know that.
Pages: [1] 2 3 ... 25