MPLAB snap to atmega328pb program and debugWIRE

Go To Last Post
110 posts / 0 new

Pages

Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

hi i want to know how to connect Microchips new programmer MPLAB SNAP to atmega328pb

i found the link below
i just want to sure is it works with MPLAB SNAP or not

Table 1 with refrance to AVR ISP (& Dw)

http://microchipdeveloper.com/pi...

and also what is pin2 connect to VTG?

and is its possible to debug atmega328pb with MPLAB SNAP using reset pin of microcontroller

as per datasheet says under DBG - debugWIRE On-chip Debug System heading?

if so how to?

If you looking for piece then prepare for war.

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

Well according to the table in the product sheet the Snap should support AVR: http://ww1.microchip.com/downloa...

 

"VTG" typically means Vtarget or simply the supply voltage of the target MCU.

 

Also regarding debugging - it does look like Snap supports debugging of AVR through debugWire, but I have not tried it myself. It's probably like Schrödinger's cat - you cannot really know until you try it.

/Jakob Selbing

Last Edited: Sun. Jan 27, 2019 - 01:33 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

It should work exactly the same as any other debugWIRE chip.
Connect all the ISP lines, VCC, GND.
Make sure that there are no capacitors on the RST/dW pin. Any external pullup must be 10k or higher. No pullup is fine.
.
Follow tutorials for mega328P. The 328PB should work the same.
.
I do not have a SNAP. I am sure that it will work fine. I would be interested to hear how fast debugWIRE is for load and debug.
ATMEL-ICE is reasonable. XMINI is very SLOW.
.
David.

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

MPLABX 5.05 didn't work well or at all with DW, 5.10 is supposed to work but I'm too lazy to try, maybe wait for v6.0. wink

John Samperi

Ampertronics Pty. Ltd.

www.ampertronics.com.au

* Electronic Design * Custom Products * Contract Assembly

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

js wrote:

MPLABX 5.05 didn't work well or at all with DW, 5.10 is supposed to work but I'm too lazy to try, maybe wait for v6.0. wink

 

But, but, Microchip expects you to test their Alpha release software they release  cool

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

AHA!! But when you reach my age and prefer cruising, holidaying or even gardening some things become low priorities.

John Samperi

Ampertronics Pty. Ltd.

www.ampertronics.com.au

* Electronic Design * Custom Products * Contract Assembly

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

So, I ordered a Snap programmer.

It should program my Nano clone M328P chips.

 

It arrived today, that was mighty fast as I just ordered them a day or two ago.

 

Of course, today the MC site, once I found the page that lists their IDEs, won't let me download the MPLab X IDE, even after I signed in with my MC account.

 

I get an error: "The website declined to show this webpage".

 

sigh.

 

Studio 7 takes forever to download, but at least Atmel let me do so...

 

How frustrating.

 

Not a good start with this device.

 

JC

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

DocJC wrote:

Of course, today the MC site, once I found the page that lists their IDEs, won't let me download the MPLab X IDE, even after I signed in with my MC account.

I get an error: "The website declined to show this webpage".

 

 My bet is they block any and all connection attempts from the state of oHIo

 

They are doing site changes so give it a bit and try again

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

My bet is they block any and all connection attempts from the state of Ohio

Funny!

 

JC 

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

So, the Out-Of-Box experience is continuing to go downhill fast.

 

The MC web site eventually let me download MPLab X IDE.

 

I plug in my new SNAP programmer (USB) and Windows goes "ding", so far life is looking good.

 

But, unfortunately, I can't find a way to select my programming hardware.

I select what I think is a good option to select a programmer and download a file and I can't find the right options.

So I read through the startup / new user manual and it doesn't answer my questions.

 

So I go to the MC Forum, and attempt to use my AVRFreaks Login, which IIRC we were told were all registered at the MC site to make it seamless for us, (back in the days when Michael was still around).

But no luck.

So I create a new log in ID and find the SNAP sub-Forum but I can't post a question, because my new account has to be approved...

 

Eventually I load the MPLab X IPE instead of the MPLab X IDE and it has recognized my new SNAP Programmer.

 

Life is looking good, again.

 

So,  let's look for how to connect the 8 In-Line pins on the SNAP programmer to a generic Mega328P, (actually a Nano with a 2x3 ISP Header).

And let's look some more.

And let's try a little Google'ing.

And let's follow a link or two to totally useless "information" pages...

 

And lets call it a night before my blood pressure goes through the ceiling.

 

Electronics / micros is suppose to be what I do to relax after a long day in my other job.

 

Not too relaxing interacting with the new Over Lords and their web site this evening.

 

I expected better.

 

Four+ hours or so invested in this and I still haven't even flashed an LED on a Nano...

 

</vent>

 

JC

Last Edited: Fri. Feb 22, 2019 - 04:51 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

DocJC wrote:

So,  let's look for how to connect the 8 In-Line pins on the SNAP programmer to a generic Mega328P, (actually a Nano with a 2x3 ISP Header).

 

Any use?...

 

#1 This forum helps those that help themselves

#2 All grounds are not created equal

#3 How have you proved that your chip is running at xxMHz?

#4 "If you think you need floating point to solve the problem then you don't understand the problem. If you really do need floating point then you have a problem you do not understand." - Heater's ex-boss

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

I do not own a SNAP.

I do own a PicKIT-4.

 

The first job is to make an adapter from 8x1 to the Atmel-style 3x2 and 5x2 JTAG.

I did this with 8x1 angle header,  3x2, and 5x2 box header and a small piece of protoboard.

 

This means that you can use a regular 6-way ribbon for ISP, PDI, UPDI, ... and a regular 10-way ribbon for JTAG.

Without any fear of wrong wiring.

 

The PicKIT-4 was recognised by Windoze.

Runs fine with MPLAB or AS7.

 

I would expect the SNAP to be equally painless.  i.e. with up to date MPLAB or AS7.

 

I am surprised that we have not heard much about SNAP.    I expected that several members would have already bought SNAP.

It is incredibly cheap.    It seems to do everything that ATMEL-ICE can do.    Just with inconvenient connector and missing case.

 

David.

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

DocJC wrote:
I select what I think is a good option to select a programmer and download a file and I can't find the right options.
mEDBG?

DocJC wrote:
Electronics / micros is suppose to be what I do to relax after a long day in my other job.
day job

When did electronics and embedded systems design become relaxing?

(from one who missed that boat)

 


https://www.avrfreaks.net/forum/come-join-us-mplab-now-supports-avrs?page=5#comment-2643626

 

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

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

Another instance of the information in your post plus DGI :

MPLAB® PICkit™ 4 Debugger Pinouts for Interfaces - Developer Help

due to MPLAB® Snap Pinout Information - Developer Help

 

edit: Table 1's Module line needs an edit.

 

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

Last Edited: Fri. Feb 22, 2019 - 02:04 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

david.prentice wrote:
It is incredibly cheap.
Instead, would you consider inexpensive? smiley

https://www.avrfreaks.net/forum/mplab-snap#comment-2631221

david.prentice wrote:
It seems to do everything that ATMEL-ICE can do.
MPLAB X v5.15 device support :

SAM E70, MPLAB Snap

SAM E70Q21, both

SAM S70, MPLAB Snap

SAM V70, MPLAB Snap

SAM V71, MPLAB Snap

SAM V71Q21, both

Arm Cortex-M23 (SAM L10 and L11), Atmel-ICE

AVR :

XMEGA, Atmel-ICE and MPLAB PICkit 4

Otherwise, MPLAB Snap has very good coverage when compared to Atmel-ICE's complete coverage.

btw, MPLAB Snap covers almost all of dsPIC33C ('18's new dsPIC)

david.prentice wrote:
Just with inconvenient connector ...
for some Microchip boards.

Tag-Connect has their MPLAB PICkit 3 product (6 pins) that should be a match for MPLAB Snap debugWIRE :

Tag-Connect Solutions for Microchip PICkit 3 - Tag Connect

david.prentice wrote:
... and missing case.
Maybe not for long due to the near ubiquity of 3D printers.

 

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

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

Surely "inexpensive" is just a posh way of saying "cheap".

 

I can buy the SNAP for £8.75 + £1.75 VAT from Farnell.   It would arrive at my door tomorrow.

I can buy the SNAP for £8.71 + £5.13 delivery + £2.77 VAT  from Microchip with the discount.    Expected 26 February.

 

Yes,   it is very inexpensive from Farnell.    There is a minimum charge for non-account holders.

 

IMHO,    any tools need to have standard cables with standard connectors.

Microchip boards expect a 8x1 connector or similar. 

Atmel boards expect 3x2 or 5x2 connectors in 2.54mm or 1.27mm pitch

 

I do not have a 3-D printer.   But that would be an excellent solution.

 

I have too many tools.   It would be interesting to hear from a SNAP owner.

I would expect it to appear as an EDBG device rather than mEDBG.   Either way,   I would like to compare performance with regular EDBG.

 

David.

Last Edited: Fri. Feb 22, 2019 - 03:22 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

david.prentice wrote:
IMHO,    any tools need to have standard cables with standard connectors.

MPLAB® Snap Additional Items Needed - Developer Help

...

  • a full-featured Micro-B USB cable (data and power), no longer than 1.5 meters, to connect to a computer (e.g., the Microchip Part Number ATUSBMICROCABLE-XPRO)

...

 

edit : https://new.microchipdirect.com/product/search/all/ATUSBMICROCABLE

 

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

Last Edited: Fri. Feb 22, 2019 - 04:45 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Wow, Brian's table has the AVR ISP pinout conversion, (MISO, MOSI, SCK), in the table.

I am sure I found many similar tables but without the AVR ISP column.

Perhaps they were early versions, before the AVR's were added to the capability of the firmware.

 

Regarding using the SNAP with Xmega's, there is a three colored chart of supported chips and NONE of the Xmegas were listed as currently supported, although some of the literature says the programmer supports the PDI interface...

So it does but it doesn't support the Xmegas...

 

I'm a happy camper again, with Brian's table.

Off to the basement to make a converter/jumper cable and give it a try.

 

Side comment, (after already hijacking this Thread...):

Those who don't learn from History are destine to repeat it.

 

Atmel built the original Dragon without mounting holes.

For an open PCB design for which the end user generally had to fabricate their own case that was a hassle.

Atmel learned, and when they came out with the Dragon V2 PCB it had mounting holes!

 

Apparently none of the design group from the Dragon sat at the table when they spec'd out the SNAP, as it has no mounting holes.

Having them would have made making a 3-D printed case so much easier than simply trying to lock in the PCB by its edges. especially with R5 and R10 1/2 mm from the edge of the board.

 

GChapman's link to the PicKit4 Developer's guide also has the AVR ISP pinout within the table.

Truly, yesterday before my rant, I followed several different links to the PicKit4 device info, and it showed a table devoid of the AVRISP info.

That, in fact, is specifically what led to my original comment about useless data links / information pages.

 

I appreciate everyone's comments and input!

 

JC

Last Edited: Fri. Feb 22, 2019 - 05:05 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

This is silly.   You can buy a Micro-B USB cable at your local supermarket.

 

Buying ribbon cable,  IDC connectors,  header pins, box headers, ... are not available over the shop counter.

I have all these parts.   I suspect that DocJ has them too.    All available via Ebay.

 

Connecting a UPDI or JTAG target needs to have the correct pins.

 

Yes,   I know that the SNAP is intentionally designed to be the cheapest debugger that can be manufactured.

Making an Atmel "adapter" is simple.    It transforms the PICkit-4 (or SNAP) into an excellent tool.

 

YMMV

 

David.

Last Edited: Fri. Feb 22, 2019 - 05:10 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I *think* I found my table on some Microchip wiki thing I stumbled across.

#1 This forum helps those that help themselves

#2 All grounds are not created equal

#3 How have you proved that your chip is running at xxMHz?

#4 "If you think you need floating point to solve the problem then you don't understand the problem. If you really do need floating point then you have a problem you do not understand." - Heater's ex-boss

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

DocJC wrote:
Off to the basement to make a converter/jumper cable and give it a try.
May you have joy

DocJC wrote:
Having them would have made making a 3-D printed case so much easier than simply trying to lock in the PCB by its edges. especially with R5 and R10 1/2 mm from the edge of the board.
picture in this thread's post 1, R5 and R10 at top right :

MPLAB Snap | AVR Freaks

USB dongles are small and some don't have mounting holes due to having to fill the available space with at least minimally essential parts; creating injection molds for such cases is a difficult task.

A case by a 3-D printer may have enough capture of the MPLAB SNAP PCBA by the micro USB type-B connector and the SIL connector; maybe those two connectors will be anchored in the PCB design and be configuration controlled.

The ones at Microchip might not consider an injection-molded case for MPLAB Snap because it must not be at a loss (MCU profit centers)

Am thankful of MPLAB Snap being on a somewhat periodic sale.

 


Delivery Date of Nitrokey Storage and Other News | Nitrokey

(second paragraph)

Background: Why is a simple piece of plastic such an issue? Developing a simple plastic case can be an extremely expensive, complicated and time-consuming process. ...

PowerStream Polymer Products injection molding, mold design, and injection mold production in Utah Valley, Orem UT

fyi, some injection molding machine operators in the US earn approximately 10USD/hour.

 

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

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

david.prentice wrote:
This is silly.   You can buy a Micro-B USB cable at your local supermarket.
Some of the issues in this fora are corrected by ones replacing the USB cable (inadequate strain relief due to inadequate overmold, one miss-pulls the cable, the device fell onto the floor "butter-side down" [sheared USB connectors, jerked USB cable])

A new arrival at Mouser though only some of the USB 3 cables are in-stock; USB 2 micro-B arrive 25-Feb'19 (1m) and 3-May'19 (1.5m) :

USB Cable Assemblies - Molex | Mouser

fyi, a USB speed issue (debugger firmware updates by USB 3 SuperSpeed or USB 2 High-Speed)

file : MPLAB X v5.15, Readme for MPLAB Snap.htm

9.3       Other Tool SSRs (System Service Requests)

The following is a list of issues that are being tracked for other tools but are related to this tool.

PK4-31

The firmware update will fail with either the MPLAB PICkit 4 or the MPLAB Snap ICD tool, when using:

- USB Full-speed port 
- USB Full-speed hub 
- USB Full-speed isolator

Workaround:

The tool would have to be plugged into a USB Full-speed or USB SuperSpeed USB port/hub/isolator to allow the firmware update process to complete successfully.

After the firmware update completes, the tool can then be plugged back into a USB Full-speed port/hub/isolator.

 

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

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

OK, I'm an unhappy camper, again.

Out-of-the-Box experience with the MC SNAP continues on a downward spiral.

 

MPLab X IPE v5.15 downloaded fine on my Win10 desktop.

Plug in the SNAP, using any of 4 different USB cables, and Windows goes Ding, and the Device Manager shows that it is a MC device, installed, and working.

The IPE shows the SNAP and its serial number in the Tool window.

 

I select M328P from the pull down list in the Device box, and click apply, and I get a yellow dot adjacent the Device box.

 

I click Connect and I always get an error:

 

Data transmission failed. Error code -10121 returned while trying to receive USB data.

A communication error with the debug tool has occurred. The tool will be reset and should re-enumerate shortly.
Connection Failed.

 

I actually purchased a couple of SNAPS, and all of them give the same error message.

 

As the IPE listed the SNAP and its serial number, one would think that the software successfully located and communicated with the programmer, (unless it simply read the info from a Win 10 USB connected device list).

 

I did wire up a 8-Pin in-line to 2x3 Pin female AVR ISP adapter cable.

That took only a few minutes.

When things failed I then rechecked what is suppose to connect to what, and I have it correct, per the table above.

The target Nano is good, and externally powered, as I can program it fine through Studio 7 and an AVR ISP MkII.

 

I suspect that the IPE isn't communicating with the SNAP, however, and that I haven't even gotten to the point of the SNAP communicating to the micro.

 

Four MORE hours spent on this and I still haven't flashed an LED.

 

Frustrated and disappointed...

 

I did, BTW, post a Thread in the MC Forum, SNAP sub-forum.

But as a new member my post has to be approved by a Moderator.

 

JC 

 

Edit:  If a Moderator wanted to split this into its own Thread that would be fine.

When I tacked onto the SNAP Thread I didn't envision this being such an agonizing process.

Topic: SNAP Programmer setup issue.

 

Thanks, JC

 

 

Last Edited: Fri. Feb 22, 2019 - 09:00 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Jay,

 

Please connect to a regular Uno or any other AVR board.

 

The Nano and especially Chinese Nanos have stupidly strong 1k0 pullups on the /RESET line.

 

I will dig out a Nano and see how the PICkit4 gets on.   From memory,   one Atmel programmer did not like a Nano.

And obviously there is no need to ever use an external programmer.   The Nano comes with a proper Bootloader.

 

David.

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

Hi David,

 

Good thought.

Unfortunately it resulted in the same error.

 

I connected it to an Uno, again a known good board that programs fine with my usual programmers.

Windows disconnects the device, then reconnects it, but the "connection failed" error persists.

 

Edit:

I also tried it on a custom PCB, M328PB,  ext 10K pullup.

I changed the chip in the IPE, and the Connect action fails similarly to both of the above.

Windows disconnects, reconnects, but the Connection Faired error persists.

 

JC

 

Last Edited: Fri. Feb 22, 2019 - 10:47 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Both STK500 and PICkit4 could read ID in AS7.

 

MPLABX IPE v5.10 seems very odd.   It took a long time to read ID and to read 32kB Flash.

I had never used the IPE.    I only used IDE v5.10

 

I will install MPLABX v5.15

 

David.

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

I installed v5.15

 

IPE "connects" to the PICkit4 in 12 secs.

It reads 32kB Flash in 14 secs.

 

IPE detects a mega4809-Curiosity board.    But it refuses to connect.

IDE recognises the Curiosity board.  It attempts to upgrade nEDBG firmware but fails.

 

I will try the 4809 project in AS7.

 

David.

 

Edit.   AS7 was quite happy with the Curiosity.    However it reported v1.0.2 firmware on Tool,  v1.0.1 firmware on Disk.

MPLABX might have invented the v1.0.2.   Obviously AS7 only knows v1.0.1

 

Last Edited: Sat. Feb 23, 2019 - 12:05 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi David,

Thank you for spending the time to give this a try.

It makes me feel better to know that I am not just missing something simple on the User Interface to make it suddenly work.

But still quite frustrating that you can't make it work, either.

 

When you connected to the Curiosity with Studio 7, what were you using for your hardware programmer device?

I didn't see anywhere in what I read that Studio would support the SNAP, and when I tried it my setup didn't recognize it or connect to it as a programmer.

I assume you were using a classic AVR programmer with Studio to connect to the Curiosity board.

 

Also, were you running v5.15 under Windows, Linux, or Mac?

 

Thanks,

 

JC

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

So I looked at a list, (partially shown below, I couldn't make a link work), of SNAP supported devices and the AVR M328P and M328PB are YELLOW, meaning preliminary , Beta support.

Now I could swear that before I ordered the SNAPS I looked at a similar page that showed they were GREEN, fully supported, (and confirming that it wasn't an Xmega32E5 programmer, (RED)).

Since my last two projects used the M328P and M328PB I thought I'd give it a try.

 

The M4809 is also YELLOW listed, so I guess not too surprising David's board didn't connect either.

 

I think their marketing department's comments that the SNAP now supports AVR's is a bit mis-leading to say the least.

The only Mega's with a Green color are under the "SIMISA" tool, there are no Green ones under the SNAPD or SNAPP.

 

I have found the Microchip web site to be very slow to load, and at least the way my brain works, I've found it very difficult to find what I'm looking for.

 

I also think there are several versions of their various documents link to by different pages, and a lot of inconsistencies.

 

JC

 

Edit:Typo

 

Link to the full list fails...

Add it to the list of special user features provided by Microchip...

Partial list below:

 

 

 

 

Last Edited: Sat. Feb 23, 2019 - 01:03 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I am running AS7.0.1931 on this Win10-64 Desktop PC.   Pack Manager says that packs are up to date.

And MPLABX v5.15

 

It looks as if v5.15 will not work on my elderly Win7-32 Laptop PC.

However v5.10 does work on Win7-32.

 

The 4809-Curiosity comes with an onboard UPDI debugger (nEDBG).

The original 4809 project ran on 4809-XPRO.   Again,  this has an onboard EDBG debugger.

 

I can probably disable the onboard debuggers.   But personally I find life much easier with onboard tools.    It means a single USB cable.

 

Quite honestly,   I would expect the SNAP to work straight out of the box.    After all,  it is probably a PICkit4 under the hood.

Ah-ha.   Brits say "under the hood" and not "under the bonnet".

 

If I did not already have an ATMEL-ICE and PICkit4,   I would certainly buy a SNAP.

I am a little gobsmacked that many readers have not bought a SNAP yet.

 

Wait 24 hours.    There must be SNAP owners out there.

 

David.

Last Edited: Sat. Feb 23, 2019 - 12:53 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

So, I ordered a Snap programmer.

It should program my Nano clone M328P chips.

Did you make the modifications needed to your Nano clone to work with debugWire?  The Arduino reset circuitry will interfere with debugWire - you need to disconnected the "auto-reset" capacitor (there may be a "jumper" for this), andIIRC many Nanos have an overly strong pullup resistor on reset (1k instead of the normal 10k.)  Arduinos are not the best systems to try to use with "real tools."  (I'd recommend an Xplained Mini.)

 

 

Out-of-the-Box experience with the MC SNAP continues on a downward spiral.

I don't think I have ever seen a "professional IDE" with what I would call a "good" out-of-box experience.  Even if one has "significant experience" with largely similar IDEs, each vendor seems to throw in enough of their own requirements and customizations to make for a wasted day or two getting things to a usable state.  :-(   This is why the Arduino IDE has been such a success, in spite of its lack of capabilities (IMO.)

 

 

I can't find a way to select my programming hardware.

Are you trying to select the programming hardware on a "global" basis?  AFAIK, in MPLAB you can only select the debug tool as part of a particular "project" configuration...

 

MPLAB X Project configuration

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

I am late to the party as I was spending a couple days having fun outdoors with my son......

 

I have three MPLAB SNAP In Circuit DEbuggers sitting in front of me, is that what the topic is?  Whats the issue and I will try them out as I have not opened one yet.  I will start looking through the thread in the meantime

 

JIm

I would rather attempt something great and fail, than attempt nothing and succeed - Fortune Cookie

 

"The critical shortage here is not stuff, but time." - Johan Ekdahl

 

"Step N is required before you can do step N+1!" - ka7ehk

 

"If you want a career with a known path - become an undertaker. Dead people don't sue!" - Kartman

"Why is there a "Highway to Hell" and only a "Stairway to Heaven"? A prediction of the expected traffic load?"  - Lee "theusch"

 

Speak sweetly. It makes your words easier to digest when at a later date you have to eat them ;-)  - Source Unknown

Please Read: Code-of-Conduct

Atmel Studio6.2/AS7, DipTrace, Quartus, MPLAB, RSLogix user

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

I do own a PicKIT-4.

 

The first job is to make an adapter

Didn't yours come with the adapter board for just about anything for the PICKKIT4? Or was it supplied to just us , the illuminati? devil

John Samperi

Ampertronics Pty. Ltd.

www.ampertronics.com.au

* Electronic Design * Custom Products * Contract Assembly

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

Westfw,

Actually, I wasn't going to use the debug feature, I just wanted to download a hex file.

I've not had any problems programming the Nano Clone with my AVR ISP mkII, or the Atmel Flash programmer, but I guess there could still be an issue with it's reset circuitry.

I'll have to poke around and see what parts are on the little Nano Clone PCB.

 

I found the IDE confusing, but truth be known I didn't start off by loading a project.. etc.

 

The IPE interface seems very intuitive, if it would just work...

 

See the edited post of mine above, Post #29.

I suspect, at this point, the problem is simply that Microchip hasn't provided support for the M328P or M328PB, (or perhaps hasn't really got the AVR ISP interface up and running at all, for any of the chips???).

 

I did try the SNAP on a M328PB, custom PCB, without any Arduino reset circuitry, (it does have a 10K pull-up n the reset pin).

It failed like the Nano with its M328P.

 

We'll see if Jim can get a Windows MPLab X IPE v5.15 and SANP configuration to work with an AVR.

 

Thanks, everyone,

 

JC

 

Edit:Typo

Last Edited: Sat. Feb 23, 2019 - 01:44 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

well I just downloaded and installed a fresh copy of MPLAB to my new Win10 pro machine and I realised that I already had version 5.10 on the machine....oops.  and MPLAB for some reason is incapable of updating itself....it just downloads a whole new installation and that means I have to download new compilers etc...pain in the ass.

 

I can see the SNAP in the IPE, but cannot connect to it

 

Will work on this some more

 

Jim

 

EDIT:

Every time I try connecting to teh SNAP, it disconnects, then reconnects and I get a data transmission failure in the IPE status window

I would rather attempt something great and fail, than attempt nothing and succeed - Fortune Cookie

 

"The critical shortage here is not stuff, but time." - Johan Ekdahl

 

"Step N is required before you can do step N+1!" - ka7ehk

 

"If you want a career with a known path - become an undertaker. Dead people don't sue!" - Kartman

"Why is there a "Highway to Hell" and only a "Stairway to Heaven"? A prediction of the expected traffic load?"  - Lee "theusch"

 

Speak sweetly. It makes your words easier to digest when at a later date you have to eat them ;-)  - Source Unknown

Please Read: Code-of-Conduct

Atmel Studio6.2/AS7, DipTrace, Quartus, MPLAB, RSLogix user

Last Edited: Sat. Feb 23, 2019 - 02:47 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Doc,

How are you connecting the SNAP to the target?  From what I am reading about the SNAP it only has two data lines on the SIL connector.  I see what looks like SPI points int eh board elsewhere

 

JIm

I would rather attempt something great and fail, than attempt nothing and succeed - Fortune Cookie

 

"The critical shortage here is not stuff, but time." - Johan Ekdahl

 

"Step N is required before you can do step N+1!" - ka7ehk

 

"If you want a career with a known path - become an undertaker. Dead people don't sue!" - Kartman

"Why is there a "Highway to Hell" and only a "Stairway to Heaven"? A prediction of the expected traffic load?"  - Lee "theusch"

 

Speak sweetly. It makes your words easier to digest when at a later date you have to eat them ;-)  - Source Unknown

Please Read: Code-of-Conduct

Atmel Studio6.2/AS7, DipTrace, Quartus, MPLAB, RSLogix user

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

Ok, here is what I have so far

 

My target is a Mega328P sitting on an STK600  It is not protected, nor is it in debugwire mode

 

Tools:

AVRStudio7

MPLAB 5.15

MPIPE 5.15

 

Atmel ICE

PickKit4 with adapter board

SNAP debugger

 

Here is what I have observed:

 

Using Studio7

Atmel ICE - Connects to Studio, can read, program and debug Mega328

PickKit4 - Connects to studio, I cannot connect to target because I do not have proper adapter - one that comes with PickKit4 does not include adapter connection for 8 pin MicroSIL connector

SNAP - is not recognised by Studio

 

 

Using MpIDE 5.15

Atmel ICE - Is recognised and connects to MPIPE.  Allows me to program, erase and read part.  I cannot change fuse settings(I may be missing something on how to change fuse settings)

PickKit4 - Sees programmer.  WIll not allow connection because it does not see target voltage.  I cannot connect to target because I do not have proper adapter - one that comes with PickKit4 does not include adapter connection for 8 pin MicroSIL connector

 

SNAP - Sees snap WIll not allow connection because it does not see target voltage.  I cannot connect to target because I do not have proper adapter - one that comes with PickKit4 does not include adapter connection for 8 pin MicroSIL connector

 

All told this was not as successful as I had hoped. 

 

Will work on this more tomorrow

 

JIm

I would rather attempt something great and fail, than attempt nothing and succeed - Fortune Cookie

 

"The critical shortage here is not stuff, but time." - Johan Ekdahl

 

"Step N is required before you can do step N+1!" - ka7ehk

 

"If you want a career with a known path - become an undertaker. Dead people don't sue!" - Kartman

"Why is there a "Highway to Hell" and only a "Stairway to Heaven"? A prediction of the expected traffic load?"  - Lee "theusch"

 

Speak sweetly. It makes your words easier to digest when at a later date you have to eat them ;-)  - Source Unknown

Please Read: Code-of-Conduct

Atmel Studio6.2/AS7, DipTrace, Quartus, MPLAB, RSLogix user

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

Hi Jim,

 

Thank you for your time and interest.

 

I did not try my Atmal Flash programmer with MPLab X.

My goal was to get the new SNAP programmer up and running with MPLab X IPE v5.15

 

Brian's Post #11 has a connectivity table, which matches that in GChapman's Post #14 link (Developer's Help).

 

So I wired up a converter / connector cable to connect the SNAP to a "Standard" AVR ISP 2x3 Header.

I have a male 8 Pin in-line header  plugged into the SNAP, with a ribbon cable to a 2-3 female connector, which can then plug onto a standard 2x3 Mail ISP programming Header.

 

SNAP 8 Pin  ------> AVR ISP 2x3

#1  -->  NC

#2  -->  #2  Vtg

#3  -->  #6  Gnd

#4  -->  #1  MISO

#5  -->  #3  SCK

#6  -->  #5  Reset\

#7  -->  #4  MOSI

 

Post #23 has the error I get with MPLab X IPE:

 

Data transmission failed. Error code -10121 returned while trying to receive USB data.

A communication error with the debug tool has occurred. The tool will be reset and should re-enumerate shortly.
Connection Failed.

 

Windows disconnects and reconnects the SNAP, but I can't CONNECT to the micro.

 

Same failure mode with:

A M328P on a Clone Nano

A M328P on a custom PCB

A M328PB on a custom PCB

 

All three of the above work fine with Studio 7 and an AVR ISP mkII.

 

It would be nice to know if anyone has a working setup with Windows 10, MPLAB X IPE, and a SNAP programmer connecting via ISP to an AVR Mega chip.

 

I'm beginning to think the listing in Post #29 that says the Megas and Tinies are YELLOW means they are not currently supported at all.

 

Thankyou, again, everyone, for your input and suggestions!

 

JC

 

 

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

DocJC wrote:
Data transmission failed. Error code -10121 returned while trying to receive USB data. A communication error with the debug tool has occurred. The tool will be reset and should re-enumerate shortly. Connection Failed.

 

I get the same error when I accidentally used an adaptor I thought would work.

 

I will set up something tomorrow and see what I get. I also have a thread running in the Microchip forums to make sure I have things set up correctly.  Lets see if anyone answers.......

 

JIm

I would rather attempt something great and fail, than attempt nothing and succeed - Fortune Cookie

 

"The critical shortage here is not stuff, but time." - Johan Ekdahl

 

"Step N is required before you can do step N+1!" - ka7ehk

 

"If you want a career with a known path - become an undertaker. Dead people don't sue!" - Kartman

"Why is there a "Highway to Hell" and only a "Stairway to Heaven"? A prediction of the expected traffic load?"  - Lee "theusch"

 

Speak sweetly. It makes your words easier to digest when at a later date you have to eat them ;-)  - Source Unknown

Please Read: Code-of-Conduct

Atmel Studio6.2/AS7, DipTrace, Quartus, MPLAB, RSLogix user

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

I think that AVRs are the Cinderellas in the Microchip family now, the ugly sisters (PICs) and the step mother (Microchip) are trying to discourage users from using AVRs. devil

John Samperi

Ampertronics Pty. Ltd.

www.ampertronics.com.au

* Electronic Design * Custom Products * Contract Assembly

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

I am gobsmacked.   There is nothing complicated with AVR ISP (SPI) programming.

 

The PICkit4 knows how to do ISP, JTAG, PDI, ...

The PICkit4 knows how to talk to USB.

 

I can see no reason for SNAP to have any problems with USB or with the hardware programming protocols.

The debugger protocols should be ok.    As PICkit4 irons out any "features",   the fixes would immediately migrate to a corresponding SNAP firmware release.

 

Likewise,   any MPLABX "debug features" will get ironed out too.

At least we have a robust AS7.    I am sure that MPLABX will get there shortly.

 

@Jay,

Your message arrived on the wrong day.    I assumed that other readers would get you going within hours.

If I had realised I probably would have just bought a SNAP immediately (even if I already have too many tools)

 

The SNAP has been on the market for several months.    It must work with regular PIC16, PIC18, PIC24, PIC32, ...

I can test PIC18

I can test AVR:  ISP, PDI, JTAG, TPI

I can test ARM:  SWD, JTAG

 

David.

Last Edited: Sat. Feb 23, 2019 - 10:02 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Seems everyone got one (or more) of the damn thingies. I did too.

I'm testing with an AVR 0/1 series (tiny1616), and got the same error:

 

Data transmission failed. Error code -10121 returned while trying to receive USB data.

A communication error with the debug tool has occurred. The tool will be reset and should re-enumerate shortly.
Connection Failed.

 

There was no activity on the UPDI pin, so the error originates even before any communication with the target is attempted.

 

Then, I set the protocol to ARM. The tool uploaded some firmware, something that never happened with the AVR. So, I thought, "yeah, we're getting somewere!". There was activity on the data lines, of course it didn't detect a target because I didn't connect one.

 

So, I set the protocol back to UPDI, this time some firmware is uploaded to the tool, now the UPDI line shows signs of life and I have a new error:

 

PDI physical timed out. (25)
Snap requires an additional pullup resistor for the UPDI communication protocol. Please see the readme for more information.

Read did not complete.
 

So I think I'm getting somewhere, but now it's lunch time, can't work on an empty belly. Then I'll take a look at that readme (if I can find it, that is).

 

So my first conclusion is that Snap uploads specific firmware each time a new protocol is needed. But this is failing for AVRs for some reason, unless you upload some other protocol first. ARM worked here.

Last Edited: Sat. Feb 23, 2019 - 01:35 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

But this is failing for AVRs for some reason

See #40

John Samperi

Ampertronics Pty. Ltd.

www.ampertronics.com.au

* Electronic Design * Custom Products * Contract Assembly

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

So my first conclusion is that Snap uploads specific firmware each time a new protocol is needed. But this is failing for AVRs for some reason, unless you upload some other protocol first. ARM worked here.

Yes and no, the firmware is switched when changing between AVRs and PIC. No firmware upload though, just a switch. The AVR firmware is a derivative of the Atmel-ICE firmware.

 

See #40

Awww... 

 

I'm beginning to think the listing in Post #29 that says the Megas and Tinies are YELLOW means they are not currently supported at all

Yellow has the same meaning as it has had in MPLAB X. The  -10121  error is a USB level error... 

 

Atmel ICE - Is recognised and connects to MPIPE.  Allows me to program, erase and read part.  I cannot change fuse settings(I may be missing something on how to change fuse settings

Wrong interface maybe? Only ISP on that part can change fuses... 

 

 

And, use MPLAB X 5.15. We did a lot of improvements, especially on the ISP and debugWIRE handling in it  smiley

 

:: 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

El Tangas wrote:
Then I'll take a look at that readme (if I can find it, that is).
MPLAB X v5.15, release notes, Readme for MPLAB Snap.htm :

10    Important Notes

...

10.2   AVR UPDI Support

A 1K ohm pull-up resistor must be installed between the MPLAB Snap ICD ICSP connector's (PCB reference designator J4) pin 4 (PGD) and pin 2 (Vdd) to allow proper UPDI programming/debugging support for AVR parts that support the UPDI interface.

Note: If this 1K ohm pull-up resistor is not installed a 'PDI physical timed out. (25)' message will be issued for various operations in the MPLAB X IDE or MPLAB X IPE GUI.

...

Wow!

An order of magnitude better drive than an Atmel-ICE.

Atmel-ICE - TinyX-OCD (UPDI) Special Considerations

...

  • Pull-up resistors on the UPDI line must not be smaller (stronger) than 10kΩ. A pull-down resistor should not be used, or it should be removed when using UPDI. The UPDI physical is push-pull capable, so only a weak pull-up resistor is required to prevent false start bit triggering when the line is idle.

...

Atmel AVRISP mkII is 4.7K ohms minimum.

 

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

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

Used my snap for the first time today with the v5.15 MPLAB IPE on Linux- took 3 hours to get it to talk to a PIC16.

 

I've managed to get it to connect to and read the fuses from a tiny1614 (not tried programming it yet) - I was getting 'PDI physical timed out. (25)' errors to start with - seems you need to use a pull up (from '/opt/microchip/mplabx/v5.15/docs/Readme for MPLAB Snap.htm'):

 

A 1K ohm pull-up resistor must be installed between the MPLAB Snap ICD ICSP connector's (PCB reference designator J4) pin 4 (PGD) and pin 2 (Vdd) to allow proper UPDI programming/debugging support for AVR parts that support the UPDI interface.

 

Edit: Beaten by gchapman. I did try using a 10K resistor before I found the readme and still got the PDI timeout errors. A 1K resistor worked.

Last Edited: Sat. Feb 23, 2019 - 08:38 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

And, use MPLAB X 5.15.

Will need to try it with the PickKit4 but before then will need to get a lager SSD on my computer, the old one is pretty full and I need to keep on deleting things to install others. See what disasters the upgrade will bring.

John Samperi

Ampertronics Pty. Ltd.

www.ampertronics.com.au

* Electronic Design * Custom Products * Contract Assembly

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

And, Jim, for your question on the MPLAB forum:

Second question - I would like to start using MPLAB with the AVR processors.  When I installed 5.15 I also downloaded all of the AVR related files and the all seem to be extensions/add ons but I do not seem to see how to install them within MPLAB.  They are not installation files I know that.

Either use XC8 (available and installable from microchip.com), or if you have Atmel Studio installed then the avr-gcc from it should be automatically detected. If you have a zip of avr-gcc from microchip.com, then you need to add it. See http://microchipdeveloper.com/mp... for how. Note that currently, a upstream avr-gcc will not detect correctly and will be listed as v1.0, so it is easier to use a Atmel/Microchip built version of the compiler until we can sort that one out... 

 

I had version 5.10 on the machine and decided to upgrade to 5.15.  But it seems that there is no way to update from within MPLAB.  I have to do a full install, load the complier(XC8) and then add the add ons.  Am I missing something?  Is there a way for MPLAB to update itself without installing a whole new copy, and then deleting the old one?  I would think it could.

Not sure what addons your talking about, but when you have downloaded a new version, then on first start it should ask you if you want to migrate settings etc over from the older version. MPLAB X does not upgrade in the Atmel Studio sense (or, technically it does, but the versioning is different, MPLAB has up until now version on major+ minor, while Atmel Studio versions on major+minor+build. The policy for side-by-side installtion of minor versions is the same for Atmel Studio and MPLAB X). 

 

 Code Configurator and when I launch it I get a pop up telling me that the projects device is not supported.  I am trying the Mega328p for the test.

As mentioned over there, the device support schedule for MCC is not the same as MPLAB X, so while MPLAB X has support for most AVRs now, MCC is still working on it...

:: Morten

 

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

Last Edited: Sat. Feb 23, 2019 - 08:38 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

meolsen wrote:
Awww...
A thank you to you and all for unified memory AVR, and its ecosystem, for 5V AVR have a place.

May y'all continue that roll.

 

P.S.

cheeky

Thursday's press release :

Connect PIC® MCU Applications to Google Cloud in Minutes with Microchip’s New Development Board for Cloud IoT Core | Microchip Technology

edit :

PIC-IoT WG Development Board (AC164164) - Microchip Technology | Mouser

 

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

Last Edited: Wed. Feb 27, 2019 - 12:38 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

It's not a race ... synchronicity

Thank you for the 1K ohms confirmation; am still surprised.

 

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

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

meolsen wrote:
And, Jim, for your question on the MPLAB forum:

DAMN!! LOL!! laugh

 

Yeah I noticed that it picked up on GCC from Studio about an hour after I wrote that OP.  BUT, if MPLABX detects GCC in Studio and installs from that I should be good to go then correct?

 

meolsen wrote:
Not sure what addons your talking about, but when you have downloaded a new version, then on first start it should ask you if you want to migrate settings etc over from the older version.

It did not.  What I am typing about are the plugins.

 

meolsen wrote:
MPLAB X does not upgrade in the Atmel Studio sense......

No kidding, having two full versions of MPLABX on my machine takes quite a bit of space.

 

meolsen wrote:
As mentioned over there, the device support schedule for MCC is not the same as MPLAB X, so while MPLAB X has support for most AVRs now, MCC is still working on it...

Fair enough.  THanks

 

JIm

 

 

I would rather attempt something great and fail, than attempt nothing and succeed - Fortune Cookie

 

"The critical shortage here is not stuff, but time." - Johan Ekdahl

 

"Step N is required before you can do step N+1!" - ka7ehk

 

"If you want a career with a known path - become an undertaker. Dead people don't sue!" - Kartman

"Why is there a "Highway to Hell" and only a "Stairway to Heaven"? A prediction of the expected traffic load?"  - Lee "theusch"

 

Speak sweetly. It makes your words easier to digest when at a later date you have to eat them ;-)  - Source Unknown

Please Read: Code-of-Conduct

Atmel Studio6.2/AS7, DipTrace, Quartus, MPLAB, RSLogix user

Pages