Arduino Nano Como Programador de ISP - Espa
Arduino Nano Como Programador de ISP - Espa
Arduino Nano Como Programador de ISP - Espa
Martyn Currey
Sobre todo Arduino cosas
En un post anterior mostr cmo hacer tu propio Arduino en una tabla de pruebas . El siguiente paso
es programarlo.
Hay muchas guas en lnea sobre cmo usar un Arduino para programar un chip ATmega, dos cosas
son:
Uso de un Arduino como un AVR ISP (Programador en el sistema)
Nick Gammon gua
http://www.martyncurrey.com/arduino-nano-as-an-isp-programmer/ 1/19
4/8/2017 Arduino Nano como programador de ISP | Martyn Currey
Asum que el Nano era el mismo que el Duemilanove y utiliz el "Uso de un Arduino como un AVR
ISP (In-System Programmer)" gua en el sitio de Arduino. Por desgracia no pude conseguir que
funcione. Despus de mucha investigacin de Google descubr que necesitaba mantener el pin de
restablecimiento en el Arduino Nano alto usando un condensador entre el suelo y el pin de
restablecimiento. Ms tarde descubr que esto es especfico para ciertos Arduinos solamente.
Crear el programador
First we need to turn the Arduino Nano in to a programmer. This is done by uploading the ArduinoISP
sketch. The ArduinoISP sketch is part of the Arduino software package and can be found in the
examples folder.
Connect the Nano to the computer by USB as usual and load the AuduinoISP sketch in to the IDE. If
you have already added a capacitor to RST & GND you need to remove it.
http://www.martyncurrey.com/arduino-nano-as-an-isp-programmer/ 2/19
4/8/2017 Arduino Nano como programador de ISP | Martyn Currey
If you are using the Arduino 1.0 or later IDE you need to change the delay value of the heartbeat.
Find
// this provides a heartbeat on pin 9, so you can tell the software is running.
uint8_t hbval=128;
int8_t hbdelta=8;
void heartbeat() {
if (hbval > 192) hbdelta = -hbdelta;
if (hbval < 32) hbdelta = -hbdelta;
hbval += hbdelta;
analogWrite(LED_HB, hbval);
delay(40);
}
and change the delay(40) to delay(20). Then compile and upload the sketch.
Status LEDS
If you look at the sketch, you will see that it recommends adding status LEDs. The LEDs are optional
but I prefer to have them so I can see what is happening.
http://www.martyncurrey.com/arduino-nano-as-an-isp-programmer/ 3/19
4/8/2017 Arduino Nano como programador de ISP | Martyn Currey
I use a red LED for the heart beat and two white LEDs for error and programming.
Remove the power (USB lead) and add the resistors (220 or 330 ohm are good) and LEDS.
Reconnect the power and if everything is working you should see the LEDs quickly flicker and then
the LED on pin 9 should pulse on/off.
If every is OK, disconnect the power and add the connections to the ATmega chip
http://www.martyncurrey.com/arduino-nano-as-an-isp-programmer/ 4/19
4/8/2017 Arduino Nano como programador de ISP | Martyn Currey
http://www.martyncurrey.com/arduino-nano-as-an-isp-programmer/ 5/19
4/8/2017 Arduino Nano como programador de ISP | Martyn Currey
http://www.martyncurrey.com/arduino-nano-as-an-isp-programmer/ 6/19
4/8/2017 Arduino Nano como programador de ISP | Martyn Currey
http://www.martyncurrey.com/arduino-nano-as-an-isp-programmer/ 7/19
4/8/2017 Arduino Nano como programador de ISP | Martyn Currey
The Arduino renames the pins to make things easy for the user. The ATmega pins are shown below.
New ATmega chips are set to use the internal clock at 1MHz. We need to program the fuses so that
the external 16MHz crystal is used. The easiest way to do this is to load a boot loader. This will set
the fuses and we can over write the boot loader later.
The boards.txt file contains options for various different Arduinos. These are arranged in groups and
each Arduino model is separated by lines of #s.
##############################################################
uno.name=Arduino Uno
http://www.martyncurrey.com/arduino-nano-as-an-isp-programmer/ 8/19
4/8/2017 Arduino Nano como programador de ISP | Martyn Currey
uno.upload.protocol=arduino
uno.upload.maximum_size=32256
uno.upload.speed=115200
uno.bootloader.low_fuses=0xff
uno.bootloader.high_fuses=0xde
uno.bootloader.extended_fuses=0x05
uno.bootloader.path=optiboot
uno.bootloader.file=optiboot_atmega328.hex
uno.bootloader.unlock_bits=0x3F
uno.bootloader.lock_bits=0x0F
uno.build.mcu=atmega328p
uno.build.f_cpu=16000000L
uno.build.core=arduino
uno.build.variant=standard
##############################################################
We want to create out own entry for the bread board Arduino and it is easiest to use one of the
existing entries. Copy the uno entry and paste at the top of the file.
# See: http://code.google.com/p/arduino/wiki/Platforms
##############################################################
uno.name=Arduino Uno
uno.upload.protocol=arduino
uno.upload.maximum_size=32256
uno.upload.speed=115200
uno.bootloader.low_fuses=0xff
uno.bootloader.high_fuses=0xde
uno.bootloader.extended_fuses=0x05
uno.bootloader.path=optiboot
uno.bootloader.file=optiboot_atmega328.hex
uno.bootloader.unlock_bits=0x3F
uno.bootloader.lock_bits=0x0F
uno.build.mcu=atmega328p
uno.build.f_cpu=16000000L
uno.build.core=arduino
uno.build.variant=standard
##############################################################
uno.name=Arduino Uno
uno.upload.protocol=arduino
uno.upload.maximum_size=32256
uno.upload.speed=115200
uno.bootloader.low_fuses=0xff
uno.bootloader.high_fuses=0xde
uno.bootloader.extended_fuses=0x05
http://www.martyncurrey.com/arduino-nano-as-an-isp-programmer/ 9/19
4/8/2017 Arduino Nano como programador de ISP | Martyn Currey
uno.bootloader.path=optiboot
uno.bootloader.file=optiboot_atmega328.hex
uno.bootloader.unlock_bits=0x3F
uno.bootloader.lock_bits=0x0F
uno.build.mcu=atmega328p
uno.build.f_cpu=16000000L
uno.build.core=arduino
uno.build.variant=standard
To read the new boards.txt file the Ardiono IDE must be restarted. After restarting you should have a
new entry:
http://www.martyncurrey.com/arduino-nano-as-an-isp-programmer/ 10/19
4/8/2017 Arduino Nano como programador de ISP | Martyn Currey
http://www.martyncurrey.com/arduino-nano-as-an-isp-programmer/ 11/19
4/8/2017 Arduino Nano como programador de ISP | Martyn Currey
If everything is OK then the programming LED on the Nano ISP should light (pin 10) and the LED on
pin19 of the ATmega328P should flicker as the boot loader is uploaded.
http://www.martyncurrey.com/arduino-nano-as-an-isp-programmer/ 12/19
4/8/2017 Arduino Nano como programador de ISP | Martyn Currey
Errors
Two common errors when programming stand alone chips are
avrdude: stk500_getsync(): not in sync: resp=0x00, and
stk500_getsync(): not in sync: resp=0x15
resp=0x00 means the programmer cannot communicate with the chip. This normally means the
connections are not correct (check the wires, especially VCC and ground)or you tried to upload the
sketch using the Upload button in the IDE. Remember to use the File menu option
resp=0x15 is very common when the Arduino ISP is resetting. A simple solution is to add a 10uF
capacitor between reset and ground on the Arduino Nano (not the Atmega chip). This keeps the
reset pin high and stops the Nano resetting. Another solution is to add a 120ohm resistor between
http://www.martyncurrey.com/arduino-nano-as-an-isp-programmer/ 13/19
4/8/2017 Arduino Nano como programador de ISP | Martyn Currey
I have used a couple of different Nanos as programmers, an original that doesnt require the
capacitor, and a clone (cheap China version) that does.
It means the ATmega is not resetting. Check the connection between Arduino pin10 and the ATmega
pin 1.
This entry was posted in Arduino, ATmega and tagged Arduino Nano, ArduinoISP by Martyn.
Bookmark the permalink [http://www.martyncurrey.com/arduino-nano-as-an-isp-programmer/] .
http://www.martyncurrey.com/arduino-nano-as-an-isp-programmer/ 14/19
4/8/2017 Arduino Nano como programador de ISP | Martyn Currey
Nano Lover
on June 16, 2014 at 8:45 pm said:
Ardy
on August 14, 2014 at 1:30 am said:
nano fan
on September 17, 2014 at 5:20 pm said:
Sir,
u have a great tutorial. unfortunately i am having a problem while uploading the
bootloader. I have cross checked the whole circuit many times but the following error
is appearing again and again. Please help me.
Martyn
on September 19, 2014 at 12:34 pm said:
It sounds like you have the non P version of the chip Atmega328-PU (1E 95
14 vs Atmega328P-PU (1E 95 0F) and you may need to edit the
avrdude.conf file.
Have a look at
http://forum.arduino.cc/index.php?topic=58670.0 and
http://www.martyncurrey.com/arduino-nano-as-an-isp-programmer/ 15/19
4/8/2017 Arduino Nano como programador de ISP | Martyn Currey
http://www.instructables.com/id/Bootload-an-ATmega328/step6/ATmega328-
PU-workaround/
These may help
-F is used on the command line and allows you to ignore the the ID
mismatch.
Martyn
on January 4, 2015 at 2:07 pm said:
For anybody else coming to this. I have just had issues with the
AudionIISP reporting incorrect device signature. I have already
programmed the chip and knew it was OK. After a lot of messing
around I discovered it was a bad connection due to a faulty
breadboard.
Amogh
on October 20, 2014 at 5:17 pm said:
Really great tutorial. hooked wires and the chip to the breadboard with Nano and it
worked right away without any status LEDs !!
Thank you sir for sharing your wonderful talent! more power and keep up
Pingback: Problem when using arduino nano as isp and atmega328p-pu | Question
and Answer
http://www.martyncurrey.com/arduino-nano-as-an-isp-programmer/ 16/19
4/8/2017 Arduino Nano como programador de ISP | Martyn Currey
CHRISTOPHER DIERINGER
on December 20, 2015 at 6:14 am said:
I cant believe how helpful this tutorial was. Thank you so much! I also want to note
that I got the 0x14 _and_ the 0x15 errors originally. Some other tutorial said the first
two 0x15 retries are normal, and to ignore them. However, I got no 0x15s when I
added the 10uF cap, nor the 0x14 errors. works beautifully. Thanks again
Yushry
on February 22, 2016 at 10:43 am said:
Good day
Martyn
on February 22, 2016 at 1:42 pm said:
You need a serial to usb adaptor of some kind. The Arduino has this built in
and for stand-alone avrs I find the easiest option is to use an adaptor.
This is a link to the Sparkfun one but there are lots of other (and cheaper)
versions available.. https://www.sparkfun.com/products/9716
http://www.martyncurrey.com/arduino-nano-as-an-isp-programmer/ 17/19
4/8/2017 Arduino Nano como programador de ISP | Martyn Currey
Ramesh Adi
on July 9, 2016 at 1:40 am said:
Martyn
on July 9, 2016 at 5:11 am said:
Do you mean your AT328P already has the bootloader installed? If so, yes
you can upload this way but the bootloader will be over-written/erased when
uploading a new sketch.
If using this method to upload sketches you do not need a bootloader. The
bootloader is used to enable communication via serial/usb and since this
method does not use usb the bootloader is not required.
Massimo Rosati
on September 9, 2016 at 3:16 am said:
hasan
on September 11, 2016 at 4:18 pm said:
http://www.martyncurrey.com/arduino-nano-as-an-isp-programmer/ 18/19
4/8/2017 Arduino Nano como programador de ISP | Martyn Currey
engineer@heart
on October 20, 2016 at 1:44 am said:
Andrew
on December 29, 2016 at 1:12 am said:
Hi,
Thanks
Andrew.
Martyn
on January 4, 2017 at 5:38 am said:
juan
on March 2, 2017 at 4:09 pm said:
http://www.martyncurrey.com/arduino-nano-as-an-isp-programmer/ 19/19