Setting Up Arduino as ISP in Atmel Studio

Thread Starter

qrb14143

Joined Mar 6, 2017
112
Hi all,

I am having difficulty setting up Atmel Studio to use my Arduino UNO to program an Atmega32. I am not trying to reprogram the Arduino itself, rather I am trying to use the ArduinoISP sketch to program another device.

I am having difficulty setting up Atmel Studio to do this. After much googling, I understand that I have to setup the Arduino as an external tool. It asks for a command and an argument though and I don't know how I'm supposed to find these. Any tutorials I've read seem to pluck these lines out of thin air and offer no explanation as to where they came from and what they do.

It's really disheartening as I have enjoyed programming MSP430s and MSP432s on their development boards and I was up for learning something new but this is really putting me off.

Any assistance in setting this up would be appreciated. I just want this done so I can get on with the important business of mastering the Atmega32!
 

zariq

Joined Apr 3, 2016
15
http://www.ladyada.net/learn/avr/avrdude.html


Program Arduino Uno with Arduinoisp sketch (arduino\examples\).

set up external tool in Atmel Studio. In the argument field, tell avrdude to use the Uno as the programmer (arduino or avrisp).
If not sure of argument for external tool, do what he does in first video, use Arduino IDE to find out.
From tools menu set programmer as Arduino as ISP. Upload using shift + upload button.

If you don't want to set fuses yourself, just burn bootloader first time.
 

Thread Starter

qrb14143

Joined Mar 6, 2017
112
Well my AVR Dragon arrived yesterday and I got the ZIF header soldered up. So far so good. I connected the ISP header pins on the AVR Dragon to the ISP pins on the Atmega32-16PU as shown in the picture.

The problem is, I get the following error and I'm not sure why.

Code:
Timestamp:    2017-05-31 13:30:01.799
Severity:        ERROR
ComponentId:    20100
StatusCode:    1
ModuleName:    TCF (TCF command: Device:startSession failed.)

Failed to enter programming mode. ispEnterProgMode: Error status received: Got 0xc0, expected 0x00 (Command has failed to execute on the tool)

[CODE]
 

Attachments

Thread Starter

qrb14143

Joined Mar 6, 2017
112
Where is pin 1 of the ZIF socket? Is the ATMEL chip put in correctly?
Correct me if I'm wrong, but would it actually make any difference if I put the chip in upside down? If I'm the one making the connections with the jumper wires then wouldn't that compensate for it. I connected the jumper wires using the Atmega32 data sheet and the pinout printed on the underside of the AVR Dragon then I check for continuity with my DMM from the ISP socket to the actual IC pins just to convince myself.

Unless of course there are traces on the PCB making connections elsewhere that I can't see. I assumed that there was no connections between the ISP, JTAG and HV sockets and the ZIF header other than the ones the user makes themself.
 
Is the ISP wired correctly?

You can swap the ATmega chip around since you have accounted for it on the header.

However, pin 1 of the ISP connector must always be pin 1. Verify that it is connected correctly at that location.
 

Thread Starter

qrb14143

Joined Mar 6, 2017
112
Just to update those who have lent assistance...

I turned the chip around 180 degrees as pointed out by @StayatHomeElectronics and also crimped a new set of jumpers from scratch. The AVR dragon now works perfectly and as such I haven't bothered with the arduino since.

Thanks for the help folks.
 
Top