Questions about " Arduino as ISP "

Hi,

I'm trying to burn arduino bootloader on ATMEGA328P-PU i bought, with the help of two Arduino, as explain on this site. I put the blink sketch code for testing my stuff befor everything. later, i send the arduinoISP sketch on my arduino, and then i burn the bootloader on the new chip.
And i finally get two arduinos with the blinking led dues to the blinking sketch of the begining.. so i don't understant, when i put the arduinoISP sketch on my arduino, didn't i erase the blink sketch ? where does the arduinoISP sketch goes ?

Thanks by advance for your answer..

IIRC one of the things that happens is that "pin 13" of the target and arduino-isp system get connected together (it's the clock signal for the SPI connection.) So when arduinoISP is done and the target starts toggling pin13 to blink its led, that causes the LED to blink on the ArduinoISP board as well. (Hopefully, it converts p13 back to an input when it's done with the programming step.)

thanks for your answer :slight_smile:

I have a not so good english, so i m not sure to understand everything you reply to me, but, what i understand in that you say (and what i see during the process) is that the two led of the p13 blink simultaneous while the two boards are connected.

But, what let me more perplexe, is that i dont understand why, after loading ArduinoISP, and burning the bootloader, when i disconnect the two board and power them, i still have the sketch blink.pde working on the two boards.. witch is great, but can you explain me how work the upload of the ArduinoISP ?
is it uploaded in a différent place of memory in the chip than the blink.pde sketch i put before ? because i dont understand how the two sketchs can coexist..

The bootloader is not a sketch, but a special piece of code that gets placed into the uC flash memory at a particular location. The uC fuses must be set appropriately to indicate that a bootloader does exist, that it has permission to write to the remaining flash memory (self-program) and also to the size of the bootloader.

After the bootloader loads a sketch into the other part of flash, it then does some housecleaning and jumps to the user's program. After this point in time the bootloader becomes basically invisible to the user program unless reset is pressed.

AVRDUDE is the utility program behind Arduino that 'talks' to the uC bootloader. This writeup gives a very good overview of that utility:
http://www.ladyada.net/learn/avr/avrdude.html

Ray

great ... i will have a look to this link, thank you !! :slight_smile: