I am trying to learn to embed AVR’s into my own projects without a commercial Arduino board and have them easily reprogrammed by another, less experienced user with updates I provide. Here is a little background and several questions. I’ve been doing a lot of reading but getting more confused. I think I need more of an overview before diving into the details of avrdude. Thanks in advance for your help.
Background:
I started learning to program embedded controllers with an Arduino Uno a few weeks ago. That went very smoothly. I then wanted to use AVR’s standalone or in a minimal Arduino configuration in my own hacking projects; e.g. R/C camera controller, coupling an off-the-shelf timer to a wireless light controller, etc.
I ordered a couple of ATMEGA328p’s with the bootloader and a couple of ATtiny85’s bare from Spark Fun.
I was able to use the MIT HLT ATtiny85 tutorial to program the 85 on a breadboard without any problems using Arduino as an ISP. I can’t figure out how to do the same with the 328. But, of course I am able to program the 328 (since it has the bootloader) by placing it in the Arduino socket.
I just received an AVR Dragon and will begin learning to use it.
So here are my questions. If there is not a “?” I’m looking for confirmation that my thinking is correct.
I want to have a standard programming interface (usb or 2x3 ISP headers) on my projects so that an end user can plug to the USB port on their PC and upload new firmware that I post or email to them. The key points seem to be:
Bootloader to elliminate continued need for hardware programmer
i. I can buy a bootloaded chip or bootload it with my hardware programmer and then routine firmware updates can be done without the programmer using serial programming.
ii. I was able to program the ATtiny85 because the Arduino as ISP sketch made the Arduino function as a hardware programmer.
USB to serial converter to establish hardware link to the boot loaded chip.
i. This is built into the Arduino board
ii. It can be a separate piece plugged between a boot loaded chip and the PC. It can cost as much as a hardware programmer but it should be “safer” and simpler for the end user.
iii. There are many available and they seem to support different subsets of the AVR family. Which ones are inexpensive (for end user) and will work with 85 and 328 chips?
Software to load hex file to chip.
i. avrdude
ii. I assume one could write a “batch” file (Windows) with avrdude command lines to automate this for the end user. They would need to install winavr, download the hex file and batch file, plug in their USB to serial adapter, and execute the batch to program the chip.
iii. Could it be done from the Arduino IDE by plugging directly from PC to serial converter to project ISP (no Arduino board just a boot loaded chip)? I assume I would need to develop the Arduino suport files so that my project (chip, clock speed, etc.) would appear as a menu choice on the boards menu.
A chip specific “core”?
i. I don’t know what this is unless it is a port of Arduino commands to make them work on different AVR’s.
ii. Is it used by the compiler?
iii. Are they specific for different compilers or different IDE’s or different programming (as in chip uploading) methods or just different chips?
iv. Was this part of the HLT files I downloaded to program the ATtiny using Arduino as ISP?
v. Is this what the Arduino Tiny project is?
vi. When I compile a sketch in Arduino IDE does it use this core to create the appropriate hex file for the target chip?
vii. Would I then need to edit board.txt and other files for each chip I want to create hex files for? Is this what HLT did for the 85? Can it be done for the 328 to generate hex files for ISP loading into stand alone 328’s?