EEVblog Electronics Community Forum

Electronics => Microcontrollers => Topic started by: ChrisGreece52 on May 19, 2013, 10:31:15 am

Title: ICSP
Post by: ChrisGreece52 on May 19, 2013, 10:31:15 am
Hello ... i was messing with my arduino and then i thought ... what can you do with the ICSP and the other 6 pin header on it... I saw some videos aobut it and one said that i can hook up a mouse and the other said that it is for programming other AVR chips....
The other header i reffer to is the one behing the usb port and near to the Small atmel chip (for USB to Serial)
(http://arduino.cc/en/uploads/Main/ArduinoMega2560_R3_Front_450px.jpg)
Title: Re: ICSP
Post by: amyk on May 19, 2013, 11:10:06 am
:palm: RTFS (http://arduino.cc/en/uploads/Main/arduino-mega2560_R3-sch.pdf)... see what the ICSP header is connected to? And what the other 6-pin header is?
Title: Re: ICSP
Post by: ChrisGreece52 on May 19, 2013, 11:37:50 am
:palm: RTFS (http://arduino.cc/en/uploads/Main/arduino-mega2560_R3-sch.pdf)... see what the ICSP header is connected to? And what the other 6-pin header is?
Thanks for the schematic.As i can see both are ICSP headers (the one near the USB-Serial converter chip is for sure)
But what are they being used for???
Title: Re: ICSP
Post by: PA0PBZ on May 19, 2013, 11:42:32 am
http://lmgtfy.com/?q=ICSP (http://lmgtfy.com/?q=ICSP)
Title: Re: ICSP
Post by: Paul Price on May 19, 2013, 11:56:45 am
I program using the "C" language and not the Arduino programming syntax and I don't need the bootloader that wants to interface with the Arduino code and board so I purchased a debugger/programmer that plugs into these little sharp pins and I can directly download my compiled C-language program and also debug using this connector. This gives direct access to all the features of the MCU.
Title: Re: ICSP
Post by: ChrisGreece52 on May 19, 2013, 12:04:26 pm
http://lmgtfy.com/?q=ICSP (http://lmgtfy.com/?q=ICSP)
Thanks when i googled it the first time i got somewhere where i could not understand a thing ....
Title: Re: ICSP
Post by: ChrisGreece52 on May 19, 2013, 12:05:12 pm
I program using the "C" language and not the Arduino programming syntax and I don't need the bootloader that wants to interface with the Arduino code and board so I purchased a debugger/programmer that plugs into these little sharp pins and I can directly download my compiled C-language program and also debug using this connector. This gives direct access to all the features of the MCU.
Thanks google got me here
http://en.wikipedia.org/wiki/In-circuit_serial_programming (http://en.wikipedia.org/wiki/In-circuit_serial_programming)
But i am still confused... where can i use it ??
Title: Re: ICSP
Post by: nuhamind2 on May 19, 2013, 12:29:32 pm
The one near the small atmel is to program the small atmel.
The one near the big atmel is to program the big atmel
You don't always need those two because the big atmel is programmed through the serial port which is facilitated by the small atmel. And you don't usually re-program the small atmel as it would break it's function as USB to Serial bridge
Title: Re: ICSP
Post by: ChrisGreece52 on May 19, 2013, 12:53:57 pm
The one near the small atmel is to program the small atmel.
The one near the big atmel is to program the big atmel
You don't always need those two because the big atmel is programmed through the serial port which is facilitated by the small atmel. And you don't usually re-program the small atmel as it would break it's function as USB to Serial bridge
Got that but the ICSP can be used ONLY for programming the chip or it could be used to programm ANY chip ? (any chip you connect it to)
Title: Re: ICSP
Post by: Paul Price on May 19, 2013, 01:06:18 pm
You got the tail wagging the dog.  The ICSP is always a way to program the chip soldered on the board and it don't work the other way.
Title: Re: ICSP
Post by: nuhamind2 on May 19, 2013, 01:41:08 pm
Got that but the ICSP can be used ONLY for programming the chip or it could be used to programm ANY chip ? (any chip you connect it to)
I'm not sure what you say. To program a chip you need a programmer. Atmel release a programmer to be used with chip sold by atmel. If you want to program chip sold by other manufacture (like microchip) you need programmer from that manufacture.

Actually your arduino has a programmer (that small atmel ).If you take a look at any other development platform which has capacility to be programmed without additional devices (like STM32 discovery, TI launchpad and so on) you'll notice that there are at least 2 chip, the one to be programmed and the one act as programmer.

Since every manufacture might specify it's own way to program their chip, a programmer released by a manufacture can only be used to program their own chip.

(Except in 1st April 2013)
Title: Re: ICSP
Post by: ChrisGreece52 on May 19, 2013, 02:01:42 pm
Got that but the ICSP can be used ONLY for programming the chip or it could be used to programm ANY chip ? (any chip you connect it to)
I'm not sure what you say. To program a chip you need a programmer. Atmel release a programmer to be used with chip sold by atmel. If you want to program chip sold by other manufacture (like microchip) you need programmer from that manufacture.

Actually your arduino has a programmer (that small atmel ).If you take a look at any other development platform which has capacility to be programmed without additional devices (like STM32 discovery, TI launchpad and so on) you'll notice that there are at least 2 chip, the one to be programmed and the one act as programmer.

Since every manufacture might specify it's own way to program their chip, a programmer released by a manufacture can only be used to program their own chip.

(Except in 1st April 2013)
Thanks now i got it because i remembered i wanted to get an avr programmer module so i can program chips to use in small projects.
But i think that you can also build arduino on a breadboard use an AVR programmer to burn the bootloader and then a usb to serial converter so you cna program the chip.
Title: Re: ICSP
Post by: nuhamind2 on May 19, 2013, 02:46:42 pm
You can even turn your arduino into avr programmer
http://arduino.cc/en/Tutorial/ArduinoISP (http://arduino.cc/en/Tutorial/ArduinoISP)
Title: Re: ICSP
Post by: ChrisGreece52 on May 19, 2013, 10:15:29 pm
You can even turn your arduino into avr programmer
http://arduino.cc/en/Tutorial/ArduinoISP (http://arduino.cc/en/Tutorial/ArduinoISP)
Thats cool thank you
Title: Re: Re: ICSP
Post by: darrylp on May 20, 2013, 12:34:46 am
Quote
Actually your arduino has a programmer (that small atmel ).


Not its not the programmer for the arduino. The arduino itself has a bootloader that rograms the rest of the flash on the chip.

--
  Darryl

Title: Re: ICSP
Post by: mariush on May 20, 2013, 12:47:50 am
So to sum it up.

ICSP is a connector that brings together several wires that are needed to program a microcontroller with a programmer.  Usually, the minimum amount is voltage, ground, reset signal, data and clock.
A programmer powers up the microcontroller, sends a reset signal and then sends data which gets written in the onboard memory.

Arduino has that connector in case you want to write the programs directly to it using a programmer.

If you write the programs through USB, what actually happens is that there is already code (a firmware) inside the Arduino microcontroller which was put there using ICSP when the product was manufactured and this code takes what you give it through usb, writes it in the memory in the microcontroller and then resets itself to allow your program to run.
The firmware and the Arduino software sending data through usb to the arduino are designed in such way designed that the firmware remains in the Arduino and always starts first, and then gives up control to your program. Think of it like the microcontroller having 16 KB of disk space and the first 1 KB of disk space holds that firmware and your program is always written after the first 1 KB.

If you actually want to overwrite that firmware and write data into ALL the Arduino memory, you have to use that ICSP connector and a programmer to actually write data (almost) anywhere on the chip flash memory.

ICSP is just a method of programming chips, there's other methods like JTAG, aWire etc

Here's more info about ICSP (In Circuit Serial Programming) :

http://en.wikipedia.org/wiki/In-circuit_serial_programming (http://en.wikipedia.org/wiki/In-circuit_serial_programming)
http://en.wikipedia.org/wiki/In-system_programming (http://en.wikipedia.org/wiki/In-system_programming)