1
\$\begingroup\$

I'm trying to burn the arduino bootloader onto a chip that's been pre programmed to use 16mhz crystal. Trouble is everytime I try pprogramming using avrdude it gies the following error then a red status led starts flashing which means a short accord to the datasheet but that not possible because my scope is tell me the chip is oscillating fine. ?My dmm tells me the avr is drawing 30ma and the datasheet says it only allows 25mA. So how do I get round this issue? I only have an avr on the breadboard.

`avrdude: stk500v2_command(): command failed avrdude: stk500v2_command(): unknown status 0xc9 avrdude: stk500v2_program_enable(): cannot get connection status avrdude: initialization failed, rc=-1 Double check connections and try again, or use -F to override this check

Has anyone else had this issue or am I doing something wrong?

\$\endgroup\$

1 Answer 1

2
\$\begingroup\$

Synopsis

AvrDude is just passing through an error reported by the AVRISP, which means it can't communicate with the target.

Request for more detail

I'm assuming you are using an STK500, but we'll need a bit more detail for a more precise answer. You could start by telling us which MCU you are using as the target. If you post a netlist of your programming port connections or (better) a schematic, I can assist you further.

Generic causes

That said, the red light can be caused by any of the following generic things:

  1. No power at the target -- you ruled this out with your dmm.

  2. Incorrect pin-mapping -- the AVRISP Mark 2, uses a different pin-out for different targets. You have to make sure you wire it correctly for your host. You could also have made a mistake in the pin numbering of your PCB footprint (if you made a PCB) or jumper wiring (if you are using a breadboard). You should check (in this order):

    1. The reset pin (measure on the MCU) idles high, then goes low when you initiate AvrDude operations, and returns high once the error is reported to the console.

    2. That the programming clock from the AVRISP arrives on the correct pin of the target MCU.

    3. That the data clock from the AVRISP arrive on the correct pin of the target MCU.

  3. Incorrect target MCU specified -- the AVRISP Mark 2, uses its pins for different functions depending on which MCU it is targeting. If you tell it the wrong target, it may look at the wrong pins for the signal, not find the line in a driveable or idle condition and report an error.

  4. In older targets (like the ATMEGA103/128 family) the clock speed matters. You can't clock the AVRISP data stream faster than 1/4 the clock speed of the target.

Diagnostic aide

The very first thing you should do is switch to the latest AVR-Studio, update the firmware in the AVRISP, and try to use the included programmer software (Atmel's version of AvrDude) to do something as simple as read the chip's device ID. This will confirm that all of your hardware is ok and isolate the problem to that of a misconfigured AvrDude.

\$\endgroup\$
0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.