Using Arduino ISP to Erase Arduino Bootloader and Program Just AVR?

Go To Last Post
13 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Confusing title I know, but let me explain.

 

I have 2 arduino's, I want to take the Atmega328p chip out of one and breadboard it and program it with the Arduino ISP (Tons of examples out there).

HOWEVER, I do not want to use arduino code, or the arduino ide or anything I want to program it just using AVR code and JUST using AVR tools. Every tutorial I see mentions loading the bootloader/etc...

 

Is this still possible? is there anything I need to know? The Atmega328p chip that im breadboarding I'll be pulling off one of the Arduino's, so it's gonna have the Arduino bootloader/etc.. on it. Do I need to erase this? or can I program over this?

 

Im just a bit confused, since every "Arduino as an ISP tutorial" seems to talk about loading the Arduino bootloader, but I want to get away from that completely!.

Thanks!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

If you have an ISP programmer it will "take care" of the bootloader and just use the M328 as normal chip. Make sure that you uncheck the bootloader fuse or the chip will jump to that unused location at start up instead of starting from 0x0000

John Samperi

Ampertronics Pty. Ltd.

www.ampertronics.com.au

* Electronic Design * Custom Products * Contract Assembly

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I was reading on a forum and someone was saying you need to use a ICSP or HV programmer if I remove the Arduino bootloader. I think they may have misunderstood since Im talking about the AVR chip on the breadboard itself and NOT the Arduino im using to program it.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Yes.  Once you put the ArduinoISP sketch on your "stock" arduino, it will behave as a general purpose stk500-like ISP programmer, and can be used to program ordinary AVRs with ordinary HEX files (including AVRs that do not have Arduino support themselves.)  Note that it only supports "SPI ISP" programming, so it can NOT be used on AVRs that use TPI (some of the new "braindead" ATtiny chips) or PDI (XMega chips) or SWD (ARM chips.)  At one time, ArduinoISP did not support chips with more than 128k of flash, but that might have been fixed relatively recently...

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

It is a mystery why anyone would put a bare chip on a breadboard if they own a Uno.   The Uno is far more convenient as a development platform.

 

However,  if you do go for a bare chip,   you can program it with a USBASP or your Uno running ArduinoISP sketch.

A bare chip needs a MAX232 or FTDI before you can use a bootloader.   You might just as well go with the USBASP/ArduinoISP route.

 

If your bare chip has a RSTDISBL fuse (e.g. mega328P),  you must avoid enabling this fuse.    This is the only "error" that requires HVPP to recover.

 

Mercfh wrote:
I was reading on a forum and someone was saying you need to use a ICSP or HV programmer if I remove the Arduino bootloader.

Please post a link.   This forum used to contain lots of scare stories.    Nowadays,  it gives more realistic advice.

 

Mind you,  most AvrFreaks seem to have an overwhelming desire to shoot their own feet.   You can program RSTDISBL if you enjoy pain.

 

David.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

For breadboarding, it is much easier to use a pro-micro or nano then using a pulled chip from an uno, where you will need to supply a xtal / caps in addition to power bypass caps as well, when all of that is already on the micro/nano already! 

 

Jim

 

Click Link: Get Free Stock: Retire early! PM for strategy

share.robinhood.com/jamesc3274

 

 

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Jim beat me to it.

 

Remember when you breadboard your uC it is configured for an external Xtal.

You will need to supply one, or it won't do anything but just sit there.

By-pass caps are also needed.

0.1 uF across each Vcc/Ground and AVcc/Ground pair of pins.

Don't forget to connect ALL of the Vcc and AVcc to V+, and ALL of the Grounds to Ground.

 

Photo shows the Xtal, its two caps, and a couple of by-pass caps, (yellow and maroon, opposite sides of the chip).

 

Good luck with your projects!

 

JC

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

david.prentice wrote:

It is a mystery why anyone would put a bare chip on a breadboard if they own a Uno.   The Uno is far more convenient as a development platform.

 

However,  if you do go for a bare chip,   you can program it with a USBASP or your Uno running ArduinoISP sketch.

A bare chip needs a MAX232 or FTDI before you can use a bootloader.   You might just as well go with the USBASP/ArduinoISP route.

 

If your bare chip has a RSTDISBL fuse (e.g. mega328P),  you must avoid enabling this fuse.    This is the only "error" that requires HVPP to recover.

 

Mercfh wrote:
I was reading on a forum and someone was saying you need to use a ICSP or HV programmer if I remove the Arduino bootloader.

Please post a link.   This forum used to contain lots of scare stories.    Nowadays,  it gives more realistic advice.

 

Mind you,  most AvrFreaks seem to have an overwhelming desire to shoot their own feet.   You can program RSTDISBL if you enjoy pain.

 

David.

 

Wait im confused, this tutorial: https://www.arduino.cc/en/Tutori...

 

shows just the wires connected to it and programming it? Why would I need a MAX232? Sorry if Im not understanding im just really confused at the whole bootloader thing I guess. Remember I want this to be a purely AVR chip. No arduino associated. ( I do plan on just programming the AVR chip on the arduino at first, but I also want to breadboard it just for "fun" sake.

 

I also have this as well:https://www.sparkfun.com/product...

 

As far as breadboarding the chips, I have a bunch of external crystal oscillators and capacitors and have seen various schematics So I should be good there. 

Last Edited: Sat. Dec 24, 2016 - 05:01 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

A bare chip needs a MAX232 or FTDI before you can use a bootloader.

Wait im confused, this tutorial: https://www.arduino.cc/en/Tutori...

shows just the wires connected to it and programming it? Why would I need a MAX232?

 You only need it to use the bootloader over the serial port.  Ie, the serial port of the AVR needs TTL-level serial, you can't connect it directly to an RS232-level serial port.

Since you wanted to get rid of the bootloader, rather than use it on your breadboard, I don't think this is applicable to you.

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I thought that I was being helpful !
.
Your link shows a perfectly good tutorial. But note that the diagrams omit the important 100nF decoupling capacitors. The crystal example shows very long wiring. Just remember that the diagrams are designed for clarity and not real life.
.
A Uno or Nano would be far more convenient for development. You only need to add the external electronics required for your project. The basic mcu, decoupling, power, xtal, comms, bootloader are all contained in the Uno/Nano.
.
Just looking at Jim's breadboard photo, you can see that it all starts getting complicated.
.
If you really want a bare AVR on a breadboard, add all the essentials first. And a 3x2 programming header.
Then you can use USBASP, ATMEL-ICE, ... or even ArduinoISP to do the programming.
.
An external programmer is more convenient than a bootloader if your breadboard does not need Serial comms.
.
David.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I just use Uno boards as AVR development boards, and program them via the built in ISP header. It's hard to even get ATMEGA328P bare chips for the price I can get an Uno board, never mind the hassle of adding crystal, etc on the breadboard. Why make life difficult.

 

If I ever want to use the board as an Uno again, just program the bootloader back and connect it via the built in USB to the Arduino IDE. Lots of examples on the web of how to put an Arduino bootloader back onto a bare ATMEGA328P.

 

Keith.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I want to take the Atmega328p chip out of one and breadboard it and program it with the Arduino ISP (Tons of examples out there). HOWEVER, I do not want to use arduino code, or the arduino ide or anything I want to program it just using AVR code and JUST using AVR tools.

 By the way, you DO realize that the second part can be done without removing the ATmega328p chip from the Arduino?   You can leave it in the board (gaining all the advantages of a "proven" HW design), and still delete the bootloader and program it using "just AVR tools."

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

westfw wrote:

I want to take the Atmega328p chip out of one and breadboard it and program it with the Arduino ISP (Tons of examples out there). HOWEVER, I do not want to use arduino code, or the arduino ide or anything I want to program it just using AVR code and JUST using AVR tools.

 By the way, you DO realize that the second part can be done without removing the ATmega328p chip from the Arduino?   You can leave it in the board (gaining all the advantages of a "proven" HW design), and still delete the bootloader and program it using "just AVR tools."

This is probably what im going to do for prototyping for sure, I just wanted to do it on the breadboard just for learning purposes (Which I was finally able to).