|
1 |
| -// ArduinoISP version 04m3 |
| 1 | +// ArduinoISP |
2 | 2 | // Copyright (c) 2008-2011 Randall Bohn
|
3 | 3 | // If you require a license, see
|
4 | 4 | // http://www.opensource.org/licenses/bsd-license.php
|
5 | 5 | //
|
6 | 6 | // This sketch turns the Arduino into a AVRISP
|
7 | 7 | // using the following arduino pins:
|
8 | 8 | //
|
9 |
| -// pin name: not-mega: mega(1280 and 2560) |
10 |
| -// slave reset: 10: 10 |
11 |
| -// MOSI: 11: 51 |
12 |
| -// MISO: 12: 50 |
13 |
| -// SCK: 13: 52 |
| 9 | +// Pin 10 is used to reset the target microcontroller. |
| 10 | +// |
| 11 | +// The MISO, MOSI and SCK pins are used to communicate with the target, |
| 12 | +// on all Arduinos, these pins can be found on the ICSP header: |
| 13 | +// |
| 14 | +// MISO °. . 5V (!) Avoid this pin on Due, Zero... |
| 15 | +// SCK . . MOSI |
| 16 | +// . . GND |
| 17 | +// |
| 18 | +// On some Arduinos (Uno,...), pins MOSI, MISO and SCK are the same pins |
| 19 | +// as digital pin 11, 12 and 13, respectively. That is why many tutorials |
| 20 | +// instruct you to hook up the target to these pins. If you find this wiring |
| 21 | +// more practical, have a define USE_OLD_STYLE_WIRING. This will work even |
| 22 | +// even when not using an Uno. (On an Uno this is not needed). |
| 23 | +// |
| 24 | +// IMPORTANT: When using an Arduino that is not 5V tolerant (Due, Zero, ...) |
| 25 | +// as the programmer, make sure to not expose any of the programmer's pins to 5V. |
| 26 | +// A simple way to accomplish this is to power the complete system (programmer |
| 27 | +// and target) at 3V3. |
14 | 28 | //
|
15 | 29 | // Put an LED (with resistor) on the following pins:
|
16 | 30 | // 9: Heartbeat - shows the programmer is running
|
17 | 31 | // 8: Error - Lights up if something goes wrong (use red if that makes sense)
|
18 | 32 | // 7: Programming - In communication with the slave
|
19 | 33 | //
|
20 |
| -// 23 July 2011 Randall Bohn |
21 |
| -// -Address Arduino issue 509 :: Portability of ArduinoISP |
22 |
| -// http://code.google.com/p/arduino/issues/detail?id=509 |
23 |
| -// |
24 |
| -// October 2010 by Randall Bohn |
25 |
| -// - Write to EEPROM > 256 bytes |
26 |
| -// - Better use of LEDs: |
27 |
| -// -- Flash LED_PMODE on each flash commit |
28 |
| -// -- Flash LED_PMODE while writing EEPROM (both give visual feedback of writing progress) |
29 |
| -// - Light LED_ERR whenever we hit a STK_NOSYNC. Turn it off when back in sync. |
30 |
| -// - Use pins_arduino.h (should also work on Arduino Mega) |
31 |
| -// |
32 |
| -// October 2009 by David A. Mellis |
33 |
| -// - Added support for the read signature command |
34 |
| -// |
35 |
| -// February 2009 by Randall Bohn |
36 |
| -// - Added support for writing to EEPROM (what took so long?) |
37 |
| -// Windows users should consider WinAVR's avrdude instead of the |
38 |
| -// avrdude included with Arduino software. |
39 |
| -// |
40 |
| -// January 2008 by Randall Bohn |
41 |
| -// - Thanks to Amplificar for helping me with the STK500 protocol |
42 |
| -// - The AVRISP/STK500 (mk I) protocol is used in the arduino bootloader |
43 |
| -// - The SPI functions herein were developed for the AVR910_ARD programmer |
44 |
| -// - More information at http://code.google.com/p/mega-isp |
45 | 34 |
|
46 | 35 | #include "Arduino.h"
|
47 | 36 | #undef SERIAL
|
|
0 commit comments