0
\$\begingroup\$

I am trying to program an ATmega328P with an Arduino Uno R3. When I click 'Upload to Programmer' in the Arduino IDE (version 1.0.5), the Arduino programs itself and not the chip. Stranger still, the ArduinoISP sketch continues to run on the Arduino as well as the program that should've been burned to the chip. Here are the steps I take:

ArduinoISP sketch is open

  1. Tools > Boards > Arduino UNO
  2. Tools > Programmer > AVRISP mkII
  3. File > Upload

Upload successfully completes

  1. File > Examples > 01.Basics > Blink
  2. Tools > Boards > Arduino Nano w/ ATmega328
  3. Tools > Programmer > Arduino as ISP
  4. File > Upload Using Programmer

No AVRDUDE errors, upload appears to have successfully completed

After I take these steps, the Arduino still has the ArduinoISP heartbeat LED beating, but the pin 13 'L' LED is also blinking on and off, just like in the Blink sketch. This persists even if the Arduino is manually reset; it's as if the Arduino has 2 sketches running at once. The LED connected to pin 13 on the ATmega328P does not blink.

Here is my wiring:

Wiring

NOTE: There is also a 10uF electrolyte capacitor the Uno's between RESET (+) and GND (-) which was missed off the above diagram.

Can anybody help me program this ATmega328P? I have tried 2 different chips, and both have had the same issue.

\$\endgroup\$

2 Answers 2

1
\$\begingroup\$

If your target AVR is an Atmega328P, why are you using "Tools > Boards > Arduino Nano w/ ATmega328" and not "Tools > Boards > Arduino UNO"? If you have the ArduinoISP sketch uploaded and running on the UNO and "Arduino as ISP" selected as the programmer, it should all work.

An Arduino R3 should not need the 10uF capacitor on its RESET pin but it does no harm but remember, if you leave the capacitor in place, you can't upload to the UNO. I suggest that you start with a fresh upload of the ArduinoISP sketch to the UNO, attach the capacitor to prevent the UNO resetting and then just upload the Blink sketch to the target using "Upload using programmer" with "Arduino as ISP" selected. Make sure that the COM port is the COM port for your UNO though!

I know you have done this but it is important to use the "Arduino UNO" board type. Oh, by the way, it's a good idea to put a 10K resistor connected to VCC on the RESET pin of the target AVR.

\$\endgroup\$
-1
\$\begingroup\$

I also started to program AVR.

As far as I learned from my research, you need a bootloader burned on those chips, and you need a hardware to do that.

If you already did that, you need to program the Arduino UNO to act as a an ISP. To do, go Arduino IDE >> File >> Examples >> Arduino ISP and burn that code into ARDUINO!

After that when you put the "Makefile" and the ".c" file into a folder, you need to open the command prompt and flash them into the chip.

\$\endgroup\$
7
  • \$\begingroup\$ This is not a meaningful answer, as you are describing the same steps the poster has already listed in their question. \$\endgroup\$ Oct 29, 2014 at 19:57
  • \$\begingroup\$ Please read the first part of question and the answer again carefully. \$\endgroup\$
    – Orkun
    Oct 29, 2014 at 20:02
  • \$\begingroup\$ Not understanding the answer does not give you the right to downvote. \$\endgroup\$
    – Orkun
    Oct 29, 2014 at 21:10
  • 2
    \$\begingroup\$ The first part of this answer is incorrect. No bootloader is required on the ISP target. \$\endgroup\$ Oct 29, 2014 at 22:28
  • \$\begingroup\$ Yeah I am sure... \$\endgroup\$
    – Orkun
    Oct 30, 2014 at 4:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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