Using AVRISP MK2 with MPLAB X IDE

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

I am familiar with programming my AVR chips via AVRISP MK2 with Atmel Studio 7 on my Windows 10 PC.

Want to migrate to MPLAB X and would like to keep using my AVRISP MK2, as it is the only programmer I have.

Does MPLAB X support the MK2 programmer?  I can't find a way to do this, maybe someone else with more knowledge about this can give me a hint?

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

Start MPLABX IDE v5.15

Click on Project Properties.

You will see a list of Hardware Tools. 

 

Plug in your AVRISP-2 and see if it appears on the list.

It does not appear on my list (but I do not own an AVRISP-2)

 

If I plug a Dragon or JTAGICE-mkII into the USB neither appear on the MPLABX list.

Likewise,  if I plug a SNAP into the USB it is not recognised by AS7.0

 

I would guess that a future Release of AS7.0 will support PicKit4 and SNAP.

And a future Release of MPLABX will support AVR devices "better".

Both Pickit4 and SNAP will need Firmware upgrades too.

 

You can add an "External Tool" to AS7.0 very easily.   e.g. to use avrdude with USBASP

MPLABX does not seem to have an "External Tool" facility.    It does have "Plugins" but none appear to support an external programmer.

 

I would expect Dragon to be supported in the future.

It is unlikely that JTAGICE-mkII or AVRISP-2 will be supported by MPLABX.

 

Hey-ho.   MPLABX works well as a building environment.   Hardware debugging is not very pleasant.

If I was Microchip I would concentrate on MPLABX.   Improve debug windows and implementation.    Produce a pleasant cross-platform IDE for PIC, AVR, ARM.

Make sure that their current hardware Tools actually work properly.

 

David.

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

david.prentice wrote:
I would guess that a future Release of AS7.0 will support PicKit4 and SNAP.

...

Both Pickit4 and SNAP will need Firmware upgrades too.

https://www.avrfreaks.net/forum/pickit4-not-showing-atmel-studio-7#comment-2678206

 

"Dare to be naïve." - Buckminster Fuller

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

david.prentice wrote:
You can add an "External Tool" to AS7.0 very easily.   e.g. to use avrdude with USBASP

MPLABX does not seem to have an "External Tool" facility.

post-build is a shared characteristic (Atmel Studio, MPLAB X)

bootloaders – chipKIT® Development Platform

(near bottom)

Using AVRDUDE from within MPLAB X

...

via Using AVRDUDE from within MPLAB X (Mac OS X) | Microchip

 

P.S.

Atmel AVRISP2 has a unique serial number; IIRC, that means the Windows COM port value will be a constant.

Likewise with one of the clones.

Can I Get a Genuine Atmel AVRISP MKII? | Blog | Kanda

...

The best AVR ISP MKII we have found is by Waveshare. It acts just like the genuine Atmel programmer, including a unique serial number. 

...

 

"Dare to be naïve." - Buckminster Fuller

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

Yes,  you can use Pickit4 in AS7.0 with an Xmega.

 

You just have to:

1.  change Device to AT90CAN128 (or any Mega)

2.  select PicKit4 and JTAG

3.  change Device to ATxmega128A4 (or whatever your real target is)

 

Not exactly intuitive.   But it seems to work without having to start MPLABX.

 

Yes.  I can use Pickit4 in MPLABX with an Xmega.

 

No.  SNAP is not recognised by AS7.0

No.  SNAP does NOT support Xmega.   SNAP is recognised by MPLABX.

 

SNAP does work in MPLABX with ATmega328P and debugWIRE.

MPLABX handles debugWIRE / ISP very nicely.   Much better than AS7.0

 

David.

 

@gchapman,

 

1.  Is there any way to add an external Tool to MPLABX ?  e.g. to run AVRISP-2

2.  Is it likely that AVRISP-2 will be supported by MPLABX in the future ?

 

Last Edited: Mon. May 20, 2019 - 03:29 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

david.prentice wrote:
1.  Is there any way to add an external Tool to MPLABX ?  e.g. to run AVRISP-2
Yes (indirectly)

david.prentice wrote:
2.  Is it likely that AVRISP-2 will be supported by MPLABX in the future ?
Don't know (would be surprised as AVRISP-2 is legacy and EOL)

 


bootloaders – chipKIT® Development Platform

(near bottom)

Using AVRDUDE from within MPLAB X

...

Product Change Notification - WE142203 - 06 Jun 2014 - Product End-of-Life (EOL) Notification (ATAVRISP2, replacement is Atmel-ICE)

https://octopart.com/search?q=ATAVRISP2

 

"Dare to be naïve." - Buckminster Fuller

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

Just for the record, there are currently no plans of adding support for the MkII tools in MPLAB (Dragon, ISP2, JTAGICEmkII, STK600). So if you want it then you should probably nag support about it so that it appears on the radar smiley (although I wouldn't be overly hopefull..)

:: Morten

 

(yes, I work for Atmel, yes, I do this in my spare time, now stop sending PMs)

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

Woo-Hoo.  Thanks for the tip.

 

I feel a little embarrassed.  I had already configured an MPLABX project to do exactly that.

1.  select Project Properties

2.  select the relevant node-> Building

3.  enter this command in the "Execute this line after build" window

if ${IsDebug} == "false" avrdudewait -c arduino -P COM10 -p ${Device} -U flash:w:${ImagePath}:i

4. edit to suit.   My example invokes a batch file called avrdudewait.bat and invokes Uno bootloader on COM10

5. tick the box if you want to "enable"

6. click on the hammer icon to "build and upload"

 

My batch file is:

@set DUDE="C:\Program Files (x86)\Arduino-1.8.9\hardware\tools\avr"
@set FF=%DUDE%\bin\avrdude.exe
@set FLAGS=-C%DUDE%\etc\avrdude.conf
@if %1/==/ goto Usage
%FF% %FLAGS% %*
@if %ERRORLEVEL% equ 0 goto exit
@goto wait
:Usage
@echo Usage:%0 -p ATmega328p -c arduino -P com5 -b 57600 -U flash:w:hexfile.hex:i
@echo default:	%0 %FLAGS% ...
:wait
@pause
:exit
@set FF=
@set FLAGS=

7.  Your AVRISP-2 is probably easier

 if ${IsDebug} == "false" avrdudewait -c avrisp2 -P USB -p ${Device} -U flash:w:${ImagePath}:i

This should make MPLABX more pleasant than AS7.0 if you just want to Compile and program.  

I don't think that you have useful Macros like ${Device} in AS7.0

Hardware Debugging in MPLABX is still painful.

 

David.

Last Edited: Mon. May 20, 2019 - 05:06 PM