Trying to program Arduino with AVRISP mkII

Go To Last Post
11 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Seems fairly simple and tried the instructions on this page:

https://www.arduino.cc/en/Hackin...

 

See attached screenshot of the tools menu.

 

The only error I get is "An error occurred while uploading the sketch". It seems to compile just fine, otherwise.

 

Am I missing something obvious? Thank you.

 

And before anyone asks... The reason I'm doing this and not just using the bootloader is because I want to transition from a prototype that's using an Arduino with its IDE to a platform that uses an Atmel part but independent from the Arduino platform.

 

***************

Edit: I was able to verify that my programmer firmware is up to date and AVR Studio can read the chip.

 

Attachment(s): 

Last Edited: Thu. Nov 12, 2020 - 11:54 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0


Try enabling verbose output during upload to see if you can get a better problem description.

File/preferences menu

 

Jim

 

(Possum Lodge oath) Quando omni flunkus, moritati.

"I thought growing old would take longer"

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi Jim,

 

That was a good idea as I'm getting something useful now:

 

avrdude: Version 6.3-20190619
         Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
         Copyright (c) 2007-2014 Joerg Wunsch

         System wide configuration file is "C:\Program Files (x86)\Arduino\hardware\tools\avr/etc/avrdude.conf"

         Using Port                    : usb
         Using Programmer              : stk500v2
avrdude: usbdev_open(): did not find any USB device "usb" (0x03eb:0x2104)

avrdude done.  Thank you.

An error occurred while uploading the sketch

For some reason, it thinks I'm using an STK500 even though I've clearly selected AVRISP mkii. Do I need to select the programmer somewhere else, too?

 

Thanks,

Paul

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Can you screen shot the port selection menu?

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi mrc3,

 

If I understand your question correctly, there are no ports to chose form. See the attachment in my original post.

 

This makes sense to me as I don't have the Arduino connected via USB. I'm powering it with a 5V supply through the power port (barrel jack).

 

Are you referring to another menu not under the Tools?

 

Thanks,

Paul

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0


pkafig wrote:
See the attachment in my original post.

rather than attach it, it's easier to see if you put it in the post:

 

 

See Tip #1 in my signature, below, for how to do that:

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Sorry I forgot about that.

 

Are you sure the computer is seeing the programmer?   In Windows... right click on start menu, select device manager, and under "microchip tools" you should see a AVRISP mkii device.

 

MIke

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

awneil wrote:

See Tip #1 in my signature, below, for how to do that:

 

Ah, ok. I'm not the brightest bulb in the shed, but I catch on... :-)

 

mcr3 wrote:

Are you sure the computer is seeing the programmer?

 

Yep. The site isn't allowing me to post an image as described by awneil's signature link, but you can see it in the attachment.

 

Thanks,

Paul

Attachment(s): 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0


IIRC, there is a reset jumper link that needs to be cut, maybe that is only for DW debug use, but worth a try, to cut this link on your Uno and see if that helps.

On my Uno, its located near the large xtal, use an Xacto knife and cut the link between the two pads, you can later restore normal bootloader operation by bridging this gap with a solder blob.

Jim

 

 

(Possum Lodge oath) Quando omni flunkus, moritati.

"I thought growing old would take longer"

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0


Is this programmer a real AVRISP mkII or a cloan, please post a picture of your programmer.

If it is one of these:

you need to use the 10 pin connector, the 6 pin on this is for PDI programming.

 

Jim

 

 

(Possum Lodge oath) Quando omni flunkus, moritati.

"I thought growing old would take longer"

 

Last Edited: Fri. Nov 13, 2020 - 07:44 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi Jim (et al),

 

I cut the RESET_EN trace, but still not working. And I am definitely using a real AVRISP mkii programmer.

 

I think I'm going to put this topic on the back burner for now. While I didn't quite achieve what I wanted (yet), this has been a really good exercise. I learned or demonstrated:

1. How to program the Arduino Uno via ICSP from Atmel Studio (overwriting the bootloader).

2. Where to find the bootloader hex file and demonstrated how to reload this from Atmel Studio to put the Arduino back the way it was.

3. How to redirect the hex file from Arduino IDE compilation process and retrieve that and program with Atmel Studio via the ICSP port.

 

Other things I learned but haven't yet tried:

4. That I can build a complete C program from scratch within the Arduino IDE and tell the IDE not to use the core. This way I can still utilize the USB bridge on the Arduino board.

5. Use an FTDI cable as the USB bridge, connect that to the ICSP header, and use that to program an embedded system via the bootloader. I have a TTL-234x cable on order to do some experimenting.

 

As I learn how to transition an Arduino-based experiment to a professional/production embedded system, I want to have as many options in my toolbox as possible.

 

Thanks everyone for your help. I hope I can return the favor soon.

 

Best regards,

Paul