Pololu Robotics & Electronics
Menu
My account Comments or questions? About Pololu Contact Ordering information Distributors

Programmer v2.1 - STK500 compatible?


#1

I have just bought a Programmer v2.1, I have some ATmega328PBs to program with the bootloader within the Arduino IDE.

I have installed the Arduino IDE and driver support for A-Star but when I try to upload the bootloader I get an error;

avrdude: stk500v2_command(): command failed
avrdude: initialization failed, rc=-1
Double check connections and try again, or use -F to override
this check.
Error while burning bootloader.

As a test I connected the V2.1 to a standard UNO using AVRdudess, selecting STK500 and the correct com port. The v2.1 programmer will not read the ATmega328 at all. A clone STK500 works as expected with the same UNO.

The programmer coinfiguration utility sees the v2.1 and you can set it up. The serial uploader works too.

Windows 7 64bit.

Any ideas what the problem might be ?


#2

Hello.

It sounds like you might not be powering the target device. It is possible to power some low-current systems using the programmer, but you will need to configure it to do that. You can find detailed instructions for setting VCC to be an output in the “Power settings and status” section of the Pololu USB AVR Programmer v2 User’s Guide, which is linked to on the “Resources” tab of the programmer’s product page.

If you were already providing power from an external source, can you post pictures of your connections?

-Nathan


#3

I did try powering the target from the Programmer v2.1 and powering it from a local source. Still got the problem.

I will take some pictures.

Should the Programmer v2.1 emulate an STK500 directly, or does it need the driver installed (and working) first ?


#4

Getting somewhere.

I have been testing it on another PC (a Windows 8 laptop) and after replacing the ribbon cable I at last got the programmer to recognise an UNO correctly as ATmega328P.

Not blaming your cable, it may have got swapped with a near identical one in my box of bits.

However I have another problem. I connected the programmer to a TQFP ZIF socket using flying leads around 10cm long attached to the 0.1" pins underneath the ZF socket. An 8Mhz resonator is plugged in on leads around 2cm long.

At default ISP frequency, 1714khz, AVRdudess produces random signatures. Perhaps not surprising given the long leads, so I knock the ISP frequency back to 114khz. AVRdudess now consistently reports the correct signature for an ATmega328PB, 0x1E, 0x95, 0x16.

When burning the bootloader in the Arduino IDE it responds with an error saying the expectred signature in not correct. After a few tries it eventually works.

When I go back and check with the Programmer 2.1 utility, the ISP frequency has been reset, presuambly by the Arduino IDE, to 1714khz.

Is this expected behaviour, does the Arduino IDE reset the ISP frequency to a default.


#5

The IDE can behave differently for different boards. What board do you have selected in the Board menu? Can you set the Arduino IDE to show verbose output during upload (in the Preferences window) and then post the exact AVRDUDE command that is being executed?

-Nathan


#6

Board is Pololu A-Star 328PB
Programmer is STK500 for PoLolu A-Star 328PB
3.3V @ 8Mhz

Y:\Arduino\hardware\tools\avr/bin/avrdude -CY:\Arduino\hardware\tools\avr/etc/avrdude.conf -C+Y:\Arduino\portable\packages\pololu-a-star\hardware\avr\4.0.2/extra_avrdude.conf -v -patmega328pb -cstk500 -PCOM22 -B 0.5 -Uflash:w:C:\Users\Stuart\AppData\Local\Temp\arduino_build_151012/LED_Blink_Test.ino.hex:i


#7

We are not sure why the 1714 kHz speed is giving you trouble, but you should locate the A-Star’s platform.txt on your computer (e.g. https://github.com/pololu/a-star/blob/master/platform.txt ) and then change both instances of “-B 0.5” to “-B 4” in that file, so that the programmer uses a frequency of 114 kHz.

-Nathan


#8

OK thanks.

I am now not understanding what the purpose is of the configuration utility being able to change the ISP Frequency if when you use the Arduino IDE it ignores what has been set.

Is there a way of changing the platform.txt so that the IDE does not change the settings configured in the programmer ?


#9

You can remove the -B option (and the number that follows).

-Nathan