2

Is it possible to write an Arduino program to an AVR chip that does not have teh Arduino bootloader installed? What is the process to do so?

5

Step 1: Get yourself a programmer.

This can be anything from a USBasp to an Arduino programmed for ISP all the way to an AVR ONE!. Some can be used from the IDE, and some cannot.

Step 2: Set up the chip as expected from the entry in boards.txt and from the datasheet.

Add a crystal, decoupling caps, whatever. Don't connect power yet.

Step 3: Connect the programmer.

If using ISP, connect the ISP pins. If using JTAG, connect the JTAG pins. If using something else, see the programmer and chip documentation for connection details. You may want to connect power at this point for the next step.

Step 4: Program fuses.

Program the oscillator, BOR, CKDIV8, EESAVE fuses as desired/required. Fuse calculator.

Step 5: Compile the program and write it to the chip.

If using the IDE, select the programmer in Tools | Programmer and then hold shift when clicking the Upload button (or press Ctrl-Shift-U). If your programmer is not supported by the IDE then compile the program (Sketch | Verify/Compile or Ctrl-R), locate the temporary directory it has been built in, and use avrdude or your JTAG program to upload it to the programmer.

Step 6: There is no step 6. You're done.

I just wanted to see if you would read this far.

  • Step 7: Write a comment acknowledging the fact that you read step 6... – Lennart Rolland Feb 19 '16 at 3:36
1

If there are no memory restrictions (too large program) which eliminates this option, I'd try to write the Arduino bootloader first and then continue normally. This has the advantage of simple reprogramming if required.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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