Pages: [1] 2   Go Down
Author Topic: Confused over ISP Programmer  (Read 870 times)
0 Members and 1 Guest are viewing this topic.
0
Offline Offline
Full Member
***
Karma: 0
Posts: 144
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I've got a sketch I developed on a Uno which I then uploaded to a atmega328 on my breadboard which is running with a 8mhz xtal - all working fine. Now I've build my project on pcb and find out I now need to reflash the atmega with some new code. Instead of taking the chip out each time to reprogram I would like to use the isp.

This is where I'm not sure of how it works. I want to use my Uno to program the atmega328 on my pcb via isp. I can so this right?

I've connect sck, reset, miso, mosi from the atmega to my Uno (From this http://arduino.cc/en/uploads/Tutorial/BreadboardAVR.png)

I then tried to program the chip by setting programmer/arduino as isp and programming.


Am I supposed to be following these instructions?
http://arduino.cc/en/Tutorial/ArduinoISP

Quote
To use your Arduino board to burn a bootloader onto an AVR, you need to follow a few simple steps.
Upload the ArduinoISP firmware (in Examples) to your Arduino board.
Wire your Arduino board to the target as shown in the diagram below.
Select the item in the Tools > Board menu that corresponds to the board on which you want to burn the bootloader (not the board that you're using as the programmer). See the board descriptions on the environment page for details.
Use the Burn Bootloader > Arduino as ISP command.

What am I missing? It says  "to burn the bootloader" - I'm not burning the bootloader though?
« Last Edit: February 08, 2012, 11:09:06 am by GregM » Logged

Massachusetts, USA
Offline Offline
Tesla Member
***
Karma: 180
Posts: 8108
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

What error are you getting?
Logged

Send Bitcoin tips to: 1L3CTDoTgrXNA5WyF77uWqt4gUdye9mezN
Send Litecoin tips to : LVtpaq6JgJAZwvnVq3ftVeHafWkcpmuR1e

0
Offline Offline
Full Member
***
Karma: 0
Posts: 144
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

 avrdude: stk500_getsync(): not in sync: resp=0x00
Logged

South Texas
Offline Offline
Edison Member
*
Karma: 8
Posts: 1023
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

On your Arduino that you are using as the ISP do you have a 120Ohm resistor between +5 and reset?
There is another option using a capacitor to ground, but I am using my Arduino board as an ISP with the resistor.

Problem is this, you have to disable the Reset on the Arduino board, otherwise it resets and doesn't run the ArduinoISP at the proper time and AVRDude doesnt get the responces from the chip you are trying to program.
Logged

0
Offline Offline
Full Member
***
Karma: 0
Posts: 144
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thanks - no, don't have that resistor in place. I'll add it in and report back.
Logged

SE USA
Offline Offline
Faraday Member
**
Karma: 40
Posts: 3783
@ssh0le
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

you might have to change or add an entry to boards.txt to use avrisp or arduinoisp, or you can get the hex file and just use avrdude
Logged


0
Offline Offline
Full Member
***
Karma: 0
Posts: 144
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Should you be able to use arduino to program it? I've added the resistor and get the same error.

When I program the code should I be using the upload button, or the program bootloader button.

Also should the atmega328 be in the the Uno when I program it. I've tried it with it in and when I program using the upload but I think its flashing the atmega on the Uno rather than on my PCB.
Logged

SE USA
Offline Offline
Faraday Member
**
Karma: 40
Posts: 3783
@ssh0le
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I havent tried with an UNO but you will upload a sketch to the arduino (which is included) that makes it into an avrisp programmer, you hook that up to your target and program though the arduino to your second board/chip
Logged


0
Offline Offline
Full Member
***
Karma: 0
Posts: 144
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Anyone successfully used the Uno to do isp? Just can't seem to get it working.
Logged

United Kingdom
Offline Offline
Tesla Member
***
Karma: 220
Posts: 6587
Hofstadter's Law: It always takes longer than you expect, even when you take into account Hofstadter's Law.
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Yes, you can use the Uno as ISP. You need to disable the auto reset using either the resistor or the capacitor (both work). However, the ArduinoISP sketch as shipped with Arduino 1.0 doesn't work under Arduino 1.0 (it did under Arduino-0022). I now use TinyISP (kindly supplied by CodingBadly) instead. I've heard that the latest version of ArduinoISP hosted on github also works, but I can't confirm that.
Logged

Formal verification of safety-critical software, software development, and electronic design and prototyping. See http://www.eschertech.com. Please do not ask for unpaid help via PM, use the forum.

0
Offline Offline
Full Member
***
Karma: 0
Posts: 144
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Ahh thanks. After reading your statement I think I'm confusing myself. You program the Uno with ArduinoISP/TinyISP and then I presume to use that to program your code to the atmega328 on my PCB. So I have to have the ISP code running on the Uno.

What I"m looking for is the following. I want to do development work on my Uno and test my code each time by uploading it to the atmega on my PCB.  With the above I would need to keep on re-loading the ISP sketch and then program my code?
Logged

Global Moderator
Dallas
Offline Offline
Shannon Member
*****
Karma: 178
Posts: 12288
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
With the above I would need to keep on re-loading the ISP sketch...?

No.  Once you have the ISP code installed on your Uno and auto-reset properly disabled your Uno will act as a programmer indefinitely.  There is no need to re-load the ISP sketch.

When you are ready to do something else with your Uno, simply remove the resistor / capacitor (re-enable auto-reset).
Logged

0
Offline Offline
Full Member
***
Karma: 0
Posts: 144
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Cool - thanks.

Where can I get a copy of your TinyISP referenced above? I'm using Arduino 1.0
Logged

Global Moderator
Dallas
Offline Offline
Shannon Member
*****
Karma: 178
Posts: 12288
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset


Send me a Personal Message with your email address.
Logged

0
Offline Offline
Full Member
***
Karma: 0
Posts: 144
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

This is driving me absolutely mental!

I've uploaded Coding Badly's TinyISP to my Uno. Then on the Uno I've put a 120R between the 5V and Reset pins and a 10uF from Reset to GND. Then I've wired it up to my atmega328 using this:

http://arduino.cc/en/uploads/Tutorial/BreadboardAVR.png

On my Arduino 1.0 I've set the programmer to Arduino as ISP and set to the board to Arduino Deimilanove /w atmega328 (Also tried Arduino Uno) and  clicked on "upload using programmer" (I only just discovered that!)

I now get this error:

Binary sketch size: 1026 bytes (of a 32256 byte maximum)
avrdude: stk500_program_enable(): protocol error, expect=0x14, resp=0x50
avrdude: initialization failed, rc=-1
         Double check connections and try again, or use -F to override
         this check.

avrdude: stk500_disable(): protocol error, expect=0x14, resp=0x51

AAgghhhh!!!!!
Logged

Pages: [1] 2   Go Up
Jump to: