Getting data transmission error code - 10121, while trying to program Atmega88 through microchip debugger PG164100

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

Hi,

 

I am not able to program the Atmega88 controller through Microchip PG16410 debugger. For programming I am using MPLAB IPE V6.0. While trying to program, getting below error. I re-check connections, everything seems ok. I am using AVR ISP connections for programming. For reference tool error window and connection pictures are attached. Can someone please help us here to resolve or find the issue?

 

2022-06-10 18:28:56 +0530 - Hex file image(s) cleared.
Loading code from C:\Users\E0657199\Desktop\CM-2022-05-25-10-45.hex...
2022-06-10 18:29:44 +0530 - Hex file loaded successfully.
2022-06-10 18:29:53 +0530 - Programming...

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

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.

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

 

Attachment(s): 

This topic has a solution.

Vinit Patil

Last Edited: Tue. Jun 14, 2022 - 11:33 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Welcome!

First guess is the USB cable.

MPLAB Snap In-Circuit Debugger Components | MPLAB® Snap In-Circuit Debugger User's Guide

[bottom]

To use the MPLAB Snap In-Circuit Debugger, you will need to supply:

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

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

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

Hi tried with different working cable, but still facing same error. 

Vinit Patil

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

Connect TQFP(15) MOSI to MOSI SNAP(7).  MISO to MISO(4).

 

The AVR must be externally powered.   SNAP only reads the voltage.

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

Hi David,

 

tried with this MOSI-MOSI & MISO-MISO connection combination also. But still facing same error.

 

And yes AVR is externally powered and SNAP is getting power from AVR board.

Vinit Patil

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

I suggest that you just check your connections.   i.e.  proper ribbon cable or fixture.

 

It is always worth testing with professionally built hardware.   e.g. connect to 3x2 header on an Arduino Uno.

 

Even if your mega88 is a lash up on a breadboard it is wise to make a standard 3x2 header.

Then you can use the same custom ribbon cable that you verified on the Uno.

 

I am not familiar with IPE.   But I have used MPLABX-IDE and AS7.0 with SNAP.

 

MPLABX-IDE must update the SNAP firmware before you can use AS7.0

I suspect that both IPE and IDE will detect firmware and update as appropriate.

 

Oh,  most AVRs come out of the factory with an RC clock.   USB AVRs expect an XTAL.

If you have "experimented" with your AVR it may require an external clock signal.

But first off.  check the wires for continuity.

 

David.

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

Hi David,

 

Thanks for the recommendations. Wire connections are ok. And yes I am already using 3x2 header on AVR board. Contiguity is also checked directly between SNAP connector and AVR board uC pins, its getting. Seems no issue from connection and continuity point of view.

 

Regarding external clock, can you please elaborate? In our product Atmega88AU LQFP-32 is available with 16MHz external crystal connection.

 

Regards,

Vinit

Vinit Patil

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

mega88 comes out of the factory with 8MHz RC clock (divided by 8)

 

you have to change the clock fuses to make it use a 16MHz xtal.

some surface mount xtals do not oscillate easily but the 88 should be much more reliable than the mega88PB chip.

A bad xtal or wrong 22pF capacitors can prevent oscillation working.

 

As I said.  Verify the SNAP by connecting to a ready-made board e.g. Arduino Uno.

 

We don't know your electrical experience.   e.g. is the pcb layout designed ok?   are the correct 22pF, 100nF capacitors used ?

What country are you in ?

How and where did you obtain the ATmega88 chips ?

 

Please don't take offence.  We see many readers that get a pcb made before making a prototype.

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

Hi David,

 

Yes I will verify SNAP with Arduino Uno.

 

I am from electronics background, and from India, We are using 22pF XTAL capacitors. Its a working board, existing code is running well, now we just want to programme the updated hex file through MPLAB IPE and snap debugger (PG164100). We are first time using this snap debugger and due to this error getting stuck.

 

(Note: Existing code is running well and its flash by AVRISP MKII. Now on same working hardware, with snap debugger we are trying to flash the updated hex file.)

Vinit Patil

This reply has been marked as the solution. 
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 1

Hi David,

 

I checked the SNAP by connecting the Arduino Uno. But getting the same error. 

 

Then later as suggested I restore and updated the firmware using IPE firmware recovery tool. And then error gets resolved, AVR boards are now getting program. Thanks for the suggestions.

Attachment(s): 

Vinit Patil

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

The general rule is : update the firmware on a new programmer tool.

 

I bought one of the first SNAP boards when they came out.

There were several "firmware upgrades" before it worked 100%

And you have to do the "hardware mod" for PDI and UPDI to work

 

However from memory the ATmega328p  ISP and debugWIRE worked almost immediately.

 

Anyway,  I am pleased that you have resolved your problem.

 

David.