Olimex Support Forum

Microcontrollers => AVR => Topic started by: kylix on June 24, 2018, 05:16:50 PM

Title: AVR ISP MKII - strange issue
Post by: kylix on June 24, 2018, 05:16:50 PM
Hello,

after many hours lost trying to make this programmer work, I was almost ready to thow it to the bin (tried everything: update drivers, change firmware and tested both with Atmel Studio 7 and AVRDUDE 5.11, etc.).
I accidentaly did a test and it finally partially worked.

I'm trying to program an ATMEGA 328P chip, already soldered on a simple circuit board (Moteino).
If I connect AVR ISP MKII to the board (MISO, MOSI, SCK, VCC, GND and RST), it is not able to communicate with the chip. I'm using Windows 7 x64.

I also tried to program the chip using an Arduino Uno as ISP. Through the Arduino I can communicate with the chip and write the bootloader but I can't write the fuses (I get some verification content mismatch error).
After writing the bootloader with the help of Arduino ISP, I then connect the AVR ISP MKII and it recognises the ATMEGA 328P chip, allowing to rewrite the bootloader and set the fuses.

Am I doing something wrong? I'd like to be able to program the bootloader/fuses using only AVR ISP MKII.

Any idea of what could be the problem?

Title: Re: AVR ISP MKII - strange issue
Post by: LubOlimex on June 25, 2018, 10:18:20 AM
How is the unit listed in Windows device manager? Is it under "Jungo" tab?
Title: Re: AVR ISP MKII - strange issue
Post by: kylix on June 25, 2018, 06:14:26 PM
It is listed as "libusb-win32 devices"  (I'm using it with AVRDUDE, not AVR Studio).

I downloaded the drivers from here: https://www.olimex.com/Products/AVR/Programmers/AVR-ISP-MK2/resources/DRIVER-MK2-AS-6-7-W10.zip and I use those in the Driver-Windows-Atmel-dude folder (as the User Guide claims for Win7 and avrdude)
Title: Re: AVR ISP MKII - strange issue
Post by: LubOlimex on June 26, 2018, 11:16:19 AM
Oh, I misread. Anyway, did you try avrdude directly? If the unit works with Arduino it should work with avrdude.

Identifying this issue might be problematic since there are a lot of things that might be wrong.To me it looks like either the problem is the state of the ATmega328P chip in the beginning (maybe it has some code protection or improper fuses) or some of your avrdude/Arduino commands might be wrong.

Especially check what are the fuses related to the clock and the start up time. Try using lower ISP speed if possible.

The fastest way to lower the possibilities is to test with another ATmega328p target.
Title: Re: AVR ISP MKII - strange issue
Post by: kylix on June 26, 2018, 04:41:51 PM
I tried it on Windows with AVRDUDESS (both with avrdude 5.11 and 6.1). It just doesn't want to connect, giving some communication error.

The atmega328P chips were bought from Mouser.

Regarding the commands, I have "READ FUSES" in AVRDUDESS ... it just doesn't communicate with the chip.
Title: Re: AVR ISP MKII - strange issue
Post by: LubOlimex on July 02, 2018, 04:19:14 PM
AVRDUDESS is just graphical user interface for avrdude. If it doesn't work, then avrdude will not work also...

What is the error? Probably "avrdude.exe: stk500v2_recv_mk2: error in USB receive", right?
Title: Re: AVR ISP MKII - strange issue
Post by: kylix on July 08, 2018, 05:22:51 PM
Yes, I think the error was something like that. Though, after writing the bootloader with the Arduino programmer, AVR ISP MKII works ok for writing the fuses...
Title: Re: AVR ISP MKII - strange issue
Post by: LubOlimex on July 09, 2018, 01:53:40 PM
I think it is the same problem that persisted for years with AVRDUDE. It is described here: https://savannah.nongnu.org/bugs/index.php?40831
Title: Re: AVR ISP MKII - strange issue
Post by: kylix on July 09, 2018, 09:09:15 PM
It must be something else because it doesn't work with avrdude 5.11 either...
Title: Re: AVR ISP MKII - strange issue
Post by: JohnS on July 09, 2018, 10:53:30 PM
The actual command line used and the exact error message will give people a chance to figure why...

John