ATMEGA328PB program from Atmel Studio using MPLAB Snap

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

I am trying to program the 328PB on my 328 explained mini board using the MPLAB Snap programmer instead of the Debug on the Explained. I made an adapter from the 8 pin header on the Snap to the 6 pin header on the explained mini. When I try to configure the MPLAB Snap, I get the message:

 

The tool is in ht PIC mode now, it should be switched to AVR mode before connecting to AVR devices. Do you which to switch to AR mode?

I click Yes.

I get Communication switch mode timeout.

I click OK

Then I get

 

MPLAB Snap firmware must be updated before continuing

Version 0.00 to 0.00

Upgrade it grayed out

Click close

 

Rinse and repeat.....

 

 

JJO

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

Disconnect the 6 pin cable from the target and try again.

 

Jim

IIRC, you must first use the snap with mplab X first, then it will work with AS7

 

FF = PI > S.E.T

 

Last Edited: Wed. Jul 1, 2020 - 08:11 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

 

I made the modifications suggested on various sites for the Snap to AVR. I also removed the 4 resistors on the explained boards that connect MOSI, MISO, SCK and /Reset from the Debug to the 328BP in case the Debug drivers were not being turned off. Has anybody actually gotten all of this stuff to work?

 

I loaded MPLAB X IDE and imported my project. It compiled and I tried to load it into the explained 328BP.

 

It says it has found the Snap. 

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.

 

Launching
Could not connect to tool hardware: snap, com.microchip.mplab.mdbcore.snap.SnapToolImpl
The debugger could not be started.  Terminating debug session.
User program finished
 

JJO

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

My experience is that fresh-from-fab Snaps have to first attempt to connect to a PIC device, and then it will work with an AVR afterwards.

So make a dummy project and attempt to program a PIC.  Worth a shot.

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

Hello, I'd like to report an update since I just went through the same experience (Error code -10121).

I bought a SNAP about a month ago. Another user on this forum reported that to get the SNAP to work by first trying to connect to a ATSAMC20E1A microcontroller.

In my case this did not work, mraardvark advice instead worked fine. I do not know much about SNAP support for PIC devices, it looks like it does not support all of them, so I tried a few different devices.

With MPLAB IPE (v5.45):

1) Device PIC10F320, then tried to apply, read. At this point, IPE started to upgrade the firmware on the SNAP, I have lost the logs, I think mine shipped with firmware version 1.00, now it is 1.06 (reported by studio in device programming, tool information)

2) Device ATMEGA328P, apply. At this point SNAP rebooted and windows discovered a CMSIS device.

Switching back to Microchip Studio (AS7.0.2542), I successfully tested reading signature, fuses and program memory, debugging with debugWire with an ATMEGA328P (...to disable debugWire use Debug -> Disable debugWIRE and close).
I do not know if CMSIS device pack is needed, right now it is not installed in studio.

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

Hello, I'd like to report an update since I just went through the same experience (Error code -10121).

 

Why don't they provide a user's manual? Seems like it should cover connections, setup, using to program, etc, unless they intend to offer a lot of refunds. 

When in the dark remember-the future looks brighter than ever.   I look forward to being able to predict the future!

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

fmiz wrote:
I do not know much about SNAP support for PIC devices, it looks like it does not support all of them, so I tried a few different devices.
Indeed

Device Support | MPLAB X IDE v5.45

 


https://packs.download.microchip.com/#collapse-Microchip-Snap-TP-pdsc

 

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

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

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

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

gchapman wrote:

Indeed

Device Support | MPLAB X IDE v5.45

I had found another table on microchip site with older/inconsistent data, this instead makes sense.

As always, thanks a lot gchapman smiley