November 07, 2024, 09:13:26 PM

AVR ISP MKII - strange issue

Started by kylix, June 24, 2018, 05:16:50 PM

Previous topic - Next topic

kylix

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?


LubOlimex

How is the unit listed in Windows device manager? Is it under "Jungo" tab?
Technical support and documentation manager at Olimex

kylix

#2
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)

LubOlimex

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.
Technical support and documentation manager at Olimex

kylix

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.

LubOlimex

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?
Technical support and documentation manager at Olimex

kylix

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...

LubOlimex

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
Technical support and documentation manager at Olimex

kylix

It must be something else because it doesn't work with avrdude 5.11 either...

JohnS

The actual command line used and the exact error message will give people a chance to figure why...

John