2

Author Topic: AVR ISP mkII programming trouble  (Read 3563 times)

0 Members and 1 Guest are viewing this topic.

Offline FinnikTopic starter

  • Full Member
  • ***
  • Posts: 59
  • Helpful? 4
AVR ISP mkII programming trouble
« on: January 19, 2010, 01:50:05 PM »
Hi there,
after a long period of inactivity due to school and other things, I'm back, but running into problems trying to program my Atmega168.

So, I'm using the AVR ISP mkII programmer trying to program an Atmega168, running Ubuntu 9.10, x64.

When I hook up the programmer to my pc, the first LED turns green, when I hook up and switch on my board, the second LED turns green. The problem is thus not in a faulty connection, otherwise the second LED would have lit up orange.

Now, I was trying to read the fuse bits, because I'm using a 20 MHz crystal and first wanted to see how the fuses where set. I used Avrdude and the following command.
Code: [Select]
sudo avrdude -c avrisp2 -p atmega168 -P usb -U hfuse:r:high.txt -U lfuse:r:low.txt
It then gave me the following error:
Code: [Select]
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.


avrdude done.  Thank you.
In addition, the second LED started flashing red as it would when there's a shortcircuit on my board.
(According to a datasheet, it will do so as soon as the current on one of the lines exceeds 25 mA)
I have checked my entire board for short-circuits, but have not found anything.

Using "-F" to override the check didn't help out, it gave me the following result:
Code: [Select]
avrdude: stk500v2_command(): command failed
avrdude: stk500v2_command(): unknown status 0xc9
avrdude: stk500v2_program_enable(): cannot get connection status
avrdude: initialization failed, rc=-1
avrdude: AVR device initialized and ready to accept instructions
avrdude: Device signature = 0x000000
avrdude: Yikes!  Invalid device signature.
avrdude: Expected signature for ATMEGA168 is 1E 94 06

avrdude done.  Thank you.

I have tried searching with the use of Google with these error messages and with various combinations of "Ubuntu", "avrdude", "avrisp 2", "atmega168" and the like.
However, I did not come  across solutions that were applicable to my situation.

If anyone here would be able to help me with the solution, I would be very grateful.

« Last Edit: February 27, 2010, 01:53:00 PM by Finnik »
Think outside the box... inside is to crowded.

Offline rgcustodio

  • Robot Overlord
  • ****
  • Posts: 217
  • Helpful? 0
  • Use "Search" and ye might find answers!
Re: AVR ISP mkII programming trouble
« Reply #1 on: January 20, 2010, 05:21:04 PM »
Verify, did the device node for the programmer in "/dev" get created after insertion?
The best thing one can do when it's raining is to let it rain. - H. W. Longfellow

understanding is the path to enlightenment

Offline FinnikTopic starter

  • Full Member
  • ***
  • Posts: 59
  • Helpful? 4
Re: AVR ISP mkII programming trouble
« Reply #2 on: January 21, 2010, 09:46:33 AM »
Could you tell me how to do that?
Think outside the box... inside is to crowded.

Offline rgcustodio

  • Robot Overlord
  • ****
  • Posts: 217
  • Helpful? 0
  • Use "Search" and ye might find answers!
Re: AVR ISP mkII programming trouble
« Reply #3 on: January 21, 2010, 04:38:43 PM »
Could you tell me how to do that?

The device node is automagically created by udev. Its what most Linux systems use.
Doing an "lsusb" and a tail of the syslog messages could provide information. Also try using strace.

http://jarduino.com/2009/06/avrisp-mkii-permission-problems-with-avrdude-and-ubuntu-9-04-amd64/
This should should probably get you started.
The best thing one can do when it's raining is to let it rain. - H. W. Longfellow

understanding is the path to enlightenment

Offline FinnikTopic starter

  • Full Member
  • ***
  • Posts: 59
  • Helpful? 4
Re: AVR ISP mkII programming trouble
« Reply #4 on: February 26, 2010, 04:35:23 AM »
Well, I've made some progress...
I've got it working in a solderless breadboard now, the green led lights when I plug it in and there are no problems in reading the fuses... Apparently the problem was with my connections..

Now, I've got another problem, when I plug in the programmer on the board that I had soldered together I get the orange flashing led, indicating the programmer being wrongly connected. However, I have triple-checked the connections and they are exactly the same as those on the solderless breadboard. It's simply driving me crazy that I can't find the flaw in my work..

I suspect some evil voodoo magic (or a silly mistake), but any suggestions are still welcome.

EDIT: Forgot to mention, I have updated the firmware from 1.10 to 1.13, just in case it's useful information for anyone.

EDIT2: My problem's finally solved!!! It was a silly mistake, no voodoo magic.. I forgot to wire up power and ground to the Atmega168... Now that those are connected, everything works fine! ;D
« Last Edit: February 27, 2010, 01:55:30 PM by Finnik »
Think outside the box... inside is to crowded.

 


Get Your Ad Here