Arduino uses ISP in system programming, also called ICSP in circuit system programming. Machine code firmware is uploaded and downloaded to the board through the SPI port of the ATmega chip.
Your Arduino board has a 6pin connector ready to work with available programmers. Let's use a USBtiny. You see keyed box connectors with 6 or 10 pins on dongles and development boards.
Open Arduino SketchAny sketch you want. This code toggles IO pins on all three ports.
// toggle IO pins on PORTB, PORTC and PORTD
#define F_CPU 16000000
#include <avr/io.h>
#include <util/delay.h>
int main (void) { DDRB = 0xFF; DDRC = 0xFF; DDRD = 0xFF; // set PORT output
while(1) { PORTB++; PORTC++; PORTD++; _delay_ms(30); }} // toggle IOs
Click the check mark to verify that it compiles.
Connect the external programmer to the computer. Check in Device Manager that it has drivers to use the device. Look for unknown devices or red marks.
Connect the 10pin header on the programmer device to the 6pin header on the Uno board. Check power lamp on board. The programmer provides enough power for the Uno board.
The USBtiny came with an adaptor cable. Careful to align to pin one of the header so that the cable is oriented properly. Remove immediately if incorrect.
The box connectors have an alignment notch to help orientation and pin1 will be marked with a dot or triangle. Other devices may have the same connector wired differently.
Using the wrong tool or connecting the wrong way may damage your equipment. JTAG is a different protocol for processors like ARM cortex. ISP is more basic. MISO, MOSI, SCK are the same SPI pins 11, 12 and 13 on the side of the board.
Select External ProgrammerMenu Tools-> Programmer -> USBtinyISP. Arduino knows the device is on USB without a com port number.
Upload Using Programmer
Menu Sketch->Upload Using Programmer or Ctrl+Shift+U on keyboard.
Text will scroll on screen. Lights will blink on programmer. Message upload using programmer complete. Notice how the ribbon cable has been oriented.
Comments