• AVR Freaks

Hot!Can't connect SNAP to ATMega328P using MPLab X IPE v5.15

Author
JC911
New Member
  • Total Posts : 2
  • Reward points : 0
  • Joined: 2019/02/21 19:34:06
  • Location: 0
  • Status: offline
2019/02/22 13:33:37 (permalink)
0

Can't connect SNAP to ATMega328P using MPLab X IPE v5.15

First Post.
My goal is to use MPLab X IPE and a SNAP programmer to download a .Hex file to an AVR Mega328P, (An Arduino Nano board), using the ISP programming interface, (Not the USB Bootloader).
 
I downloaded MPLab X IPE v5.15 and it installed on my Win 10 desktop computer without difficulties.
 
I plugged in my new SNAP programmer, Windows recognizes it and the IPE shows the SNAP programmer and its serial number in the Tool window.  So one would think that the IPE successfully found and communicated with the SNAP to reads its serial number, unless it just pulled that data from the Windows USB active device / connections list.
 
I select ATmega328P from the drop down list in the Device window.  I see a yellow dot next to it after I click apply.
 
I click on the Connect button and I get the following 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 hear Windows disconnect the SNAP, and then reconnect the SNAP.
 
I think that means that the PC can't communicate with the SNAP, and we haven't even gotten to the step where the SNAP has to communicate with the micro.  The Nano is known to be good, I can program it with other software and programmers.
 
Any suggestions or guidance would be appreciated.
 
JC
#1

7 Replies Related Threads

    Jim Nickerson
    User 452
    • Total Posts : 6016
    • Reward points : 0
    • Joined: 2003/11/07 12:35:10
    • Location: San Diego, CA
    • Status: offline
    Re: Can't connect SNAP to ATMega328P using MPLab X IPE v5.15 2019/02/28 10:58:53 (permalink)
    0
    The yellow dot indicates your device is not yet fully supported/tested in your configuration.
    #2
    DevMod1
    Administrator
    • Total Posts : 456
    • Reward points : 0
    • Joined: 2009/02/10 09:34:30
    • Location: 0
    • Status: offline
    Re: Can't connect SNAP to ATMega328P using MPLab X IPE v5.15 2019/03/01 10:32:25 (permalink)
    0
    How are you connecting the MPLAB Snap and powering the Arduino Nano board??  Can you try with the IDE first as we have seen some issues with the IPE.

    _____________________________

    Please read the forum posting guidelines. Do not double post, please help keep these forums professional and comments respectful.
    Please notify the moderators of problems/spam/trolls.
    #3
    JC911
    New Member
    • Total Posts : 2
    • Reward points : 0
    • Joined: 2019/02/21 19:34:06
    • Location: 0
    • Status: offline
    Re: Can't connect SNAP to ATMega328P using MPLab X IPE v5.15 2019/03/03 14:55:39 (permalink)
    0
    Hello Everyone,
    Thank you for your interest and replies.
    Sorry for the delay in getting back to you, I was out of town.
     
    I am powering the Nano through its USB port, tried both from a PC USB and a powered hub.
    The connection from the SNAP to the micro is made via a ~ 6 inch jumper cable from an 8-inline male header to a 2x3 female connector to fit the classic AVR ISP Header.
     
    Another individual on the AVRFreaks site noted that if one first selects a SAM device, then clicks Apply, then clicks Connect (knowing that it will fail without a SAM uC connected), then selects the AVR (M328P in this case), then clicks Apply, and then clicks Connect, it WILL connect to the AVR 8-bitter.
     
    Using that work around the Win10 MPLab X IPE will connect to the AVR.
    (So the initial USB connection to the SNAP error is resolved.)
     
    BUT, when I then program a pre-compiled .Hex file the SNAP RESETS the Mega328P's "Fuses", (Configuration Bits), and changes the clock from the External 16 MHz Xtal the Nano was running on to the internal 8 MHz RC Osc with the Divide by 8 Fuse set, so the uC now runs at 1 MHz.
     
    What in the world is that all about?
     
    Although the IPE will let me see the Configuration Bits, and even do a pull down on the clock source, it won't let me change them back to how I had them set!
    It also pops up a message to say that re-setting the AVR Configuration Bits is disabled in the IPE, but one can use the IDE.
     
    That makes the IPE TOTALLY USELESS.
    I can't have it reset my Clock and other Configuration Bits every time I download a file!!!
     
    It did, however, download the .hex file, which then ran correctly, albeit 16 x slower than expected, so I know that the converter cable from the SNAP to the target AVR works fine.
     
    I did then try the IDE.  Understand I'm new to the IDE, but I found it a bit more complex to navigate then the IPE which I thought was straight forward and user friendly, (except for not working!).
     
    I spent an hour trying to get the Win 10 MPLab X IDE to let me change the M328P's Configuration Bits back the way I wanted them, and never could make it work.
     
    As the Nano has some additional circuitry on the Reset\ pin for the Arduino IDE, I also tried the MPLab X IPE and IDE on a custom M328PB board with just a 10K pull-up on the Reset\ line.  Again, neither the IPE nor the IDE will let me re-configure the Configuration Bits, ("Fuses").
     
    Know that I can program and configure the Config Bits on both the M328P and the M328PB using Studio 7.xxx and an AVR ISP mkII programmer without difficulty.
     
    I purchased three SNAPs as I was looking for a simple, low cost AVR programmer.
    The marketing pop ups on the web page said that MPLab now supports all AVRs.
     
    I don't believe that to be the case, and with the IPE resetting the ConFig Bits and no tic-the-box option to tell it NOT to do that, it is totally worthless.
     
    It would be nice if MC added TWO tic-the-box options to the IPE:
     
    1) Turn On/Off the IPE touching the AVR's Configuration Bits.
    (The default should be to NOT touch them!)
     
    2) Turn On/Off the ability to the User to configure the Configuration Bits, ("Fuses").
     
    JC
     
     
    #4
    tech24x7
    Starting Member
    • Total Posts : 60
    • Reward points : 0
    • Joined: 2013/10/14 21:38:52
    • Location: 0
    • Status: offline
    Re: Can't connect SNAP to ATMega328P using MPLab X IPE v5.15 2019/03/04 12:08:03 (permalink)
    0
    Hi,
     
    IPE till v5.15 it loads all the content from the hex and updates same in memory view. However it wont program the configuration bits separately like MPLAB X IDE. 
     
    I agree it would be nice to have tick options in the IPE:
     1) Turn On/Off the IPE touching the AVR's Configuration Bits. (The default should be to NOT touch them!)
     2) Turn On/Off the ability to the User to configure the Configuration Bits, ("Fuses")
    #5
    tech24x7
    Starting Member
    • Total Posts : 60
    • Reward points : 0
    • Joined: 2013/10/14 21:38:52
    • Location: 0
    • Status: offline
    Re: Can't connect SNAP to ATMega328P using MPLab X IPE v5.15 2019/03/04 12:10:51 (permalink)
    0
    7.14 Programming Configuration Bits of AVR and SAM Devices in MPLAB IPE
    To program the configuration bits of AVR and SAM devices in MPLAB IPE, they need to be part of the hex file only. This differs from the MPLAB X IDE, where they can be programmed separately via the configuration bits memory window.
    For PIC devices, however, the configuration bits can be programmed separately using MPLAB X IDE and MPLAB IPE.
    #6
    Tim Cruise
    Junior Member
    • Total Posts : 94
    • Reward points : 0
    • Status: offline
    Re: Can't connect SNAP to ATMega328P using MPLab X IPE v5.15 2019/04/03 09:24:46 (permalink)
    0
    Please use Atmel-ICE, instead of MPLAB SNAP, to program Arduino.  LoL
    #7
    DevMod1
    Administrator
    • Total Posts : 456
    • Reward points : 0
    • Joined: 2009/02/10 09:34:30
    • Location: 0
    • Status: offline
    Re: Can't connect SNAP to ATMega328P using MPLab X IPE v5.15 2019/04/05 09:17:13 (permalink)
    0
    I believe that there is a jumper or connection you have to remove on the Arduino boards to use an external debugger as it has its own internal debugger.

    _____________________________

    Please read the forum posting guidelines. Do not double post, please help keep these forums professional and comments respectful.
    Please notify the moderators of problems/spam/trolls.
    #8
    Jump to:
    © 2019 APG vNext Commercial Version 4.5