Show Posts
Pages: 1 [2] 3 4 ... 25
16  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
17  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...
18  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.
19  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).
20  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...
21  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).
22  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?
23  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.
24  Using Arduino / Microcontrollers / Re: Arduino's reliability on: April 09, 2013, 09:03:59 am
Take a look at the Arduino Pro made by Sparkfun, or the headerless version of the Leonardo board.  They have surface-mount chips, so no IC socket to corrode and fail.  They come without shield headers, so you can solder your shield directly to the Ardunio PCB - made easier by the low height of the SMD components.

The type of enclosure and the environment it has to withstand will greatly determine the lifetime of the electronics it contains.  If you can mount the electronics under some kind of shelter then that will help considerably.  Do you have batteries or other heat-sensitive components requiring ventilation?  If air can get out, moisture can get in.  If the enclosure is plastic and exposed to the elements, consider a sun-shade or UV-resistant paint.  A lot of plastics age badly in strong sunlight, although some last longer than others.
25  Using Arduino / Microcontrollers / Re: Question on difference between bootloaders? on: April 08, 2013, 04:20:03 pm
Look in the boards.txt file in the hardware/arduino directory of the IDE.  In there you'll find all the relevant characteristics of each board.  Use http://www.engbedded.com/fusecalc to decode the fuse values.  The settings for the Lilypad328 and ProMini 8MHz are identical.  They both require an 8MHz external resonator/crystal, and use the ATmegaBOOT bootloader running at 57600 baud.  The software doesn't care about the voltage, but the 328p chip is specced to run ok at 8MHz at any voltage between 5.5V and 2.4V.
26  Using Arduino / Microcontrollers / Re: Question on difference between bootloaders? on: April 08, 2013, 03:49:03 pm
For 328-based Arduinos there are only two bootloader families: Optiboot (as used on the Uno) and ATmegaBOOT (as used on the Duemilanove).  Each must be compiled for the appropriate CPU frequency and desired upload baud-rate, so for each bootloader there are several different binaries made for different board characteristics.

The main difference between the two is size: Optiboot fits into 512 bytes whilst ATmegaBOOT occupies 2k.  Otherwise they do much the same thing.
27  Using Arduino / Microcontrollers / Re: Looks like we have clones that look real on: April 02, 2013, 05:15:00 am
The first three octants indicate the vendor and an authentic has a sticker that is a MAC address (0xDE:0xAD:0xBE:0xEF:0xFE:0xED) registered to Gheo Sa in Switzerland.

"DEAD BEEF FEED" is commonly used in programming where an arbitrary 12 digit hex number is needed, in the same spirit as the variable names "foo" and "bar".  It comes up a lot in Arduino Ethernet demonstration code where the MAC address is defined in software.  For home networks it's usually fine, but don't count on it being unique.

As an alternative whimsical HEX number I offer "DEAF BABE CAFE", or the more sophisticated "BEADED FACADE".  Any more?
28  Using Arduino / Microcontrollers / Re: Sharing a crystal on: March 28, 2013, 07:19:08 am
Right.  That would also enable the feed-back electronics in the slave's clock, meaning I would have had to remove the resonator from the slave board.  In a custom design of course that problem would not have existed.
29  Using Arduino / Microcontrollers / Re: Sharing a crystal on: March 28, 2013, 06:02:45 am
I did this a little while ago with two Unos, driving both boards with a single crystal:

Details here: http://arduino.cc/forum/index.php?PHPSESSID=f3db89b764081d42f29e0df10a585519&topic=117172.msg882235#msg882235

A few things to note:
- The slave expects a full-swing signal.  That means that you cannot drive it directly from the master's crystal oscillator signals when configured for a low-power clock.  So you "use up" an extra pin on the master to generate the CLKO signal used by the slave.
- The start-up time is determined by the on-board low-precision oscillator.  That means that even with a shared clock the two processors will not start executing precisely together.  However once running the phase-shift will remain constant.
- Once programmed for an external clock, the slave needs that external clock to be present whenever it is being re-programmed.  That can be awkward when adjusting the fuse settings.  Luckily many of the software ISPs out there generate an emergency clock signal which can be used.
- I used unmodified Uno boards for this test, and discovered that you do not need to remove the inactive crystal / resonator on the slave.  It appears not to disturb the clock signal coming from the master.  The crystal signals are not broken out on the Uno (competitors note -- this is something you could add!), so I needed an IC probe to make the connection.

Hope that's useful, or at least interesting!

30  Using Arduino / Microcontrollers / Re: Arduino self-update on: March 24, 2013, 09:25:47 pm
One Arduino can program another, and there are an number of implementations around.  See for example Atmega_Board_Programmer by Nick Gammon (http://www.gammon.com.au/forum/?id=11635) and Optiboot by Bill Westfield (https://github.com/WestfW/OptiLoader).  These are made for writing bootloaders, but are easily adapted for any code.  They use ICSP, and need 4 programming wires plus power.

Programming via another communication protocol would require use of a bootloader.  I'm not aware of any bootloaders that use I2C, nor do I know of any existing Arduino code which can talk to a bootloader.  So the answer to your question is yes, in theory, although it might be a lot of work.
Pages: 1 [2] 3 4 ... 25