AVRISP mkII problem with AvrStudio 4.19 and Atmega32 Windows 7

Thread Starter

pepco-boy

Joined Jan 7, 2012
8
Hello everybody, working on a basic problem already several days. i bought a new micro controller Atmega32-16PU and i'm trying to program it using AVRISP MKII programmer.

Till now i did the following steps:
1) SETTING THE HARDWARE CONNECTION
The connection scheme which i used is a following:(I'm using a breadboard and i followed the connection scheme posted by Mathematics!)

On the chip I have

For Atmega32 chip

MOSI at pin 6 on chip
MISO at pin 7 on chip
SCK at pin 8 on chip
reset bar is at pin 9 on chip
VCC is at pin 10 on chip
ground is at pins 11 and 31 on chip
AVCC is at pin 30 on chip

For mkII programmer

The hole on the programmers connector nearest to the triangle (i.e right under it)
is hole one which is MISO
On the same row as MISO we have SCK then RESET
Next row has VCC for programmer , followed by MOSI then ground for programmer.

The MISO , SCK , MOSI for chip and programmer are connected directly to one another. The VCC , and ground of the programmer is connected to the solderless breadboards +/- strip respectfully.
I'm powering the board using a 9V battery which is connected a 5v regulator.
A 222uF electrolitic capacitor + leg is connected to the 9V input of Regulator, the -leg to the ground of the regulator.
A 0.1uF ceramic Capacitor connected to the - leg of the regulator and the 5V output of the regulator.

The chips VCC and AVCC are connected by a wire and then connected to the + strip.
The chips ground and Aground is connected by a wire and then connected to the - strip.
The chips reset is connected to the VCC of the chip by a 7 kohm resistor.
The programmers reset pin hole is connected to the reset of the chip.


*Both Green leds on, on the avrisp mk2 programmer

2) INSTALLING WINAVR VERSION 20100110
3) INSTALLING AVR STUDIO VERSION 4.19
4) SETTING CONNECTION IN AVR STUDIO - i chose Tools>Program AVR>Connect
in the next window i chose platform AVRISP mkii and Port : USB
I tried to read the signature but it wrote me:"Warning: Signature doesn't match the selected device" . Additionally it wrote me the following:
Setting mode and device parameters.. OK!
Entering programming mode.. FAILED!
Leaving programming mode.. OK!

5) I tried to interface the Atmega32 also with avrdude , using the following code:
"avrdude -c avrispmkII -p m32"
it wrote me the following:
"avrdude: ser_open(): can't open device "\\.\com1":The system cannot find the file specified.

6) i tried to connect my AVRISP mk2 programmer to another microcontroller atmega8 - work great!

7) I tried with a new Atmega32 - didn't work.

7) I've searched already quite a lot in different forums for the solution for my exact case,wasn't lucky to find one yet.

I'm new to this , I have a completely new Atmega32 untouched and quite stuck and not sure how to further proceed, appreciate any help!
 

hgmjr

Joined Jan 28, 2005
9,027
Hello everybody, working on a basic problem already several days. i bought a new micro controller Atmega32-16PU and i'm trying to program it using AVRISP MKII programmer.

Till now i did the following steps:
1) SETTING THE HARDWARE CONNECTION
The connection scheme which i used is a following:(I'm using a breadboard and i followed the connection scheme posted by Mathematics!)

On the chip I have

For Atmega32 chip

MOSI at pin 6 on chip
MISO at pin 7 on chip
SCK at pin 8 on chip
reset bar is at pin 9 on chip
VCC is at pin 10 on chip
ground is at pins 11 and 31 on chip
AVCC is at pin 30 on chip

For mkII programmer

The hole on the programmers connector nearest to the triangle (i.e right under it)
is hole one which is MISO
On the same row as MISO we have SCK then RESET
Next row has VCC for programmer , followed by MOSI then ground for programmer.

The MISO , SCK , MOSI for chip and programmer are connected directly to one another. The VCC , and ground of the programmer is connected to the solderless breadboards +/- strip respectfully.
I'm powering the board using a 9V battery which is connected a 5v regulator.
A 222uF electrolitic capacitor + leg is connected to the 9V input of Regulator, the -leg to the ground of the regulator.
A 0.1uF ceramic Capacitor connected to the - leg of the regulator and the 5V output of the regulator.

The chips VCC and AVCC are connected by a wire and then connected to the + strip.
The chips ground and Aground is connected by a wire and then connected to the - strip.
The chips reset is connected to the VCC of the chip by a 7 kohm resistor.
The programmers reset pin hole is connected to the reset of the chip.


*Both Green leds on, on the avrisp mk2 programmer

2) INSTALLING WINAVR VERSION 20100110
3) INSTALLING AVR STUDIO VERSION 4.19
4) SETTING CONNECTION IN AVR STUDIO - i chose Tools>Program AVR>Connect
in the next window i chose platform AVRISP mkii and Port : USB
I tried to read the signature but it wrote me:"Warning: Signature doesn't match the selected device" . Additionally it wrote me the following:
Setting mode and device parameters.. OK!
Entering programming mode.. FAILED!
Leaving programming mode.. OK!

5) I tried to interface the Atmega32 also with avrdude , using the following code:
"avrdude -c avrispmkII -p m32"
it wrote me the following:
"avrdude: ser_open(): can't open device "\\.\com1":The system cannot find the file specified.

6) i tried to connect my AVRISP mk2 programmer to another microcontroller atmega8 - work great!

7) I tried with a new Atmega32 - didn't work.

7) I've searched already quite a lot in different forums for the solution for my exact case,wasn't lucky to find one yet.

I'm new to this , I have a completely new Atmega32 untouched and quite stuck and not sure how to further proceed, appreciate any help!
You stated that the programmer worked great with the atmega8 setup.

The error message that you are encountering is often associated with the attempt to program device that is different from the one that AVRSTUDIO has been told it is connected to. You can check this out be selecting the "DEBUG" dropdown menu and scrolling down to the "Select Platform and Device". Click on this and then scroll down the list until you come to ATNEGA32 device and click on it. That will tell AVRSTUDIO that the device you are programming is the ATMEGA32.

hgmjr
 

Thread Starter

pepco-boy

Joined Jan 7, 2012
8
thanks a bunch for the advice, but unfortunately that didn't work ... i'm not sure, but i think it something to do with the connection scheme to atmega32, maybe my capacitors are not well connected, and i can't completely understand this from the datasheet. could you please explain how to connect the capacitors? and what should be there value? maybe i'm not using the correct value..thx
 

hgmjr

Joined Jan 28, 2005
9,027
If you can post a schematic of the atmega32 circuit we can see if there is anything that needs to be revised.

hgmjr
 

hgmjr

Joined Jan 28, 2005
9,027
From your schematic, I can see that you are not using an external crystal for your clock. If this is your intent then you need to make sure that you select as your clock source the internal RC oscillator frequency of your choosing. You need to do that by programming the correct fuse in the ATMEGA32.

Have you done that yet?

hgmjr
 

Thread Starter

pepco-boy

Joined Jan 7, 2012
8
yeah, i'm not using any external oscillator, i read somewhere that by default the Atmega32 internal oscillator is setup to 1 Mhz already, am i wrong?? my main problem is that i still don't have any communication between the programmer and the atmega32,if i'm wrong about the default state of the atmega32 is there a way how to set up the internal oscillator without setting any communication between the programmer and the micro controller first?
 

hgmjr

Joined Jan 28, 2005
9,027
All you should need to do is go to the programmer mode and once you are there you will be provided with a tab labeled FUSES. Click on that tab and you will see the selection SUT_CKSEL. Click on the small down pointing triangle to the right and you will be presented with a menu of clock sources to chose from. Pick one of the INTERNAL RC CLOCK OSCILLATORS as your clock.

hgmjr
 

hgmjr

Joined Jan 28, 2005
9,027
I haven't encountered that error message screen before. I will take a closer look at your connection diagram to see if there is any clue to your problem there.

hgmjr
 

hgmjr

Joined Jan 28, 2005
9,027
Your diagram shows the ISP6PIN header connection wiring to be correct. It is a top view diagram.

Did you state that all of the leds on the programmer were green?

As you know, the programmer that you are using is not designed to power the target AVR. The +5V connection is there only to monitor the presence of the +5V on the target's power supply pin.

Is your +5V supply rail measuring near to or at +5V when measured using a DVM?

hgmjr
 

hgmjr

Joined Jan 28, 2005
9,027
Can you tell us what you found to be the holdup in keeping things from working? We will all benefit from your experience.

hgmjr
 

Thread Starter

pepco-boy

Joined Jan 7, 2012
8
sure, i just used the wrong value for the capacitor, i replaced the 0.22uF with 0.1uF , and i changed also the value of the resistor from 7kohm to 10kohm. probably there is a minimal value to the RESET pin...
 
Top