Society of Robots - Robot Forum

Software => Software => Topic started by: jkerns on August 28, 2012, 11:53:09 AM

Title: AVRISP MK II - works with avrdude, but not with avr studio 4
Post by: jkerns on August 28, 2012, 11:53:09 AM
OK, I know, just use AVRDUDE. Thanks. But...

I wanted to change fuses to change the clock frequency - load up AVR studio, tell it I have the AVRISP MK II, ATMEGA32 chip, try to connect and I get "Connect failed, select AVR programmer".

The light is green, I get a green flash when I plug in the USB...

Now, I try avrdude to see what happens.

That seems to work. I get lights flashing and the following (as an example)

Code: [Select]
M:\>avrdude -p M32 -c avrispmkii -P usb -v

avrdude: Version 5.10, compiled on Jan 19 2010 at 10:45:23
         Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
         Copyright (c) 2007-2009 Joerg Wunsch

         System wide configuration file is "C:\WinAVR-20100110\bin\avrdude.conf"


         Using Port                    : usb
         Using Programmer              : avrispmkii
avrdude: usbdev_open(): Found AVRISP mkII, serno: 000200067118
         AVR Part                      : ATMEGA32
         Chip Erase delay              : 9000 us
         PAGEL                         : PD7
         BS2                           : PA0
         RESET disposition             : dedicated
         RETRY pulse                   : SCK
         serial program mode           : yes
         parallel program mode         : yes
         Timeout                       : 200
         StabDelay                     : 100
         CmdexeDelay                   : 25
         SyncLoops                     : 32
         ByteDelay                     : 0
         PollIndex                     : 3
         PollValue                     : 0x53
         Memory Detail                 :

                                  Block Poll               Page
      Polled
           Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  Max
W   ReadBack
           ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ---
-- ---------
           eeprom         4    10    64    0 no       1024    4      0  9000  90
00 0xff 0xff
           flash         33     6    64    0 yes     32768  128    256  4500  45
00 0xff 0xff
           lfuse          0     0     0    0 no          1    0      0  2000  20
00 0x00 0x00
           hfuse          0     0     0    0 no          1    0      0  2000  20
00 0x00 0x00
           lock           0     0     0    0 no          1    0      0  2000  20
00 0x00 0x00
           signature      0     0     0    0 no          3    0      0     0
 0 0x00 0x00
           calibration    0     0     0    0 no          4    0      0     0
 0 0x00 0x00

         Programmer Type : STK500V2
         Description     : Atmel AVR ISP mkII
         Programmer Model: AVRISP mkII
         Hardware Version: 1
         Firmware Version Master : 1.10
         Vtarget         : 5.0 V
         SCK period      : 8.00 us

avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.03s

avrdude: Device signature = 0x1e9502
avrdude: safemode: lfuse reads as E1
avrdude: safemode: hfuse reads as 99

avrdude: safemode: lfuse reads as E1
avrdude: safemode: hfuse reads as 99
avrdude: safemode: Fuses OK

avrdude done.  Thank you.

So, it seems to me that the device is hooked up OK and capable of talking to yea olde chip.

Now, I could just use avrdude to change the fuses, but it makes me nervous to work with the raw hex - it's been 20 years since I used to do that stuff... And it's bugging me that I can't get the AVR studio to work.

Any guess about what I'm doing wrong?

Oh, and I've tried two different AVR ISP mk II programmers.
Title: Re: AVRISP MK II - works with avrdude, but not with avr studio 4
Post by: newInRobotics on August 28, 2012, 03:54:06 PM
Have You tried AVR Studio 5 or Atmel Studio 6?
Title: Re: AVRISP MK II - works with avrdude, but not with avr studio 4
Post by: Webbot on August 28, 2012, 07:21:58 PM
All AVRDUDE is telling you is that your computer can talk to the AVRISP. You've told it on the cmd line that its an ATMega32 chip, and it has found the programmer.
Don't think it proves that the programmer is talking to the chip.

Looks like you're using AVRDUDE on a PC - in which case it will have been compiled with its own libusb.dll support. It could be that AVRStudio can't find the libusb drivers or you have installed over the top of the ones that AVR Studio installs.

See http://mightyohm.com/blog/2010/09/avrisp-mkii-libusb-drivers-for-windows-7-vista-x64/ (http://mightyohm.com/blog/2010/09/avrisp-mkii-libusb-drivers-for-windows-7-vista-x64/)
Title: Re: AVRISP MK II - works with avrdude, but not with avr studio 4
Post by: jkerns on August 30, 2012, 07:34:38 AM
Thanks.

I tried installing AVR studio 6, uninstalling the driver for the AVRISP mkII, letting it re-install - no luck.  I assume that it must be that AVR is using a different driver that is not actually connected to the programmer.

I guess I'll just work with winavr / avrdude for now. That has worked for me before for programming this chip. I just need to track down the bit by bit data on the fuses...

Thanks for the suggestions.