Atmega128 ISP programming ERROR

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

Hello everyone,

I want to program atmega128 through AVRISP MK2, but getting error

 

 

 

My Hardware connections are:

 

MOSI >> PE0(PDI)

MISO >> PE1(PDO)

SCK   >> PB1

RESET>> RESET pin

VCC   >> Vcc pin

GND   >> Gnd pin

PEN   >> FLOATING

SS    >> FLOATING

 

XSTAL >> external >> 7.372800MHz

 

AVCC >> VCC
AREF  >> VCC 
AGND  >> GND 

 

AVRISP MK2  >> FIRMWARE FULLY UPDATED

FUSE BIT Settings are

 

 

NOW, the strange part is, the chip only first time entered in programming mode, it did erase, Load hex onto flash, fuse bits, and then suddenly, it gave me above error of picture 1, afterwards,  I repeatedly tried to re-enter into programming mode, but it failed to enter again.

 

Kindly Help

 

 

Hello

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

M. Naveed wrote:
the chip only first time entered in programming mode, it did erase, Load hex onto flash, fuse bits,

So then we'll make a guess that the connections are OK.

 

The symptoms sound like a missing clock source.  Do you have a crystal?  With proper specs, and proper load caps?  Do you see oscillation on XTAL2?

 

There is a Tutorials forum article on "recovering from a locked-out AVR" that might be useful.

You can put lipstick on a pig, but it is still a pig.

I've never met a pig I didn't like, as long as you have some salt and pepper.

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

With CKSEL 3-0 programmed you have selected external CLOCK not external CRYSTAL and you have no clock now. So you need to inject a clock into the chip and program the correct fuse vales.

 

John Samperi

Ampertronics Pty. Ltd.

www.ampertronics.com.au

* Electronic Design * Custom Products * Contract Assembly

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

That is the classic symptom of incorrect clock fuse for the hardware you actually have.

 

With all 4 of the CKSEL bits set (eg, "0"), you have selected "External Clock". External Clock is a stand-alone oscillator that runs whether or not the micro has power. This is not the same as "External Crystal or Resonator". Do you have an external clock on your board and connected to the micro?

 

<EDIT>Argg, Johan beat me to it!</EDIT>

 

Jim

Jim Wagner Oregon Research Electronics, Consulting Div. Tangent, OR, USA http://www.orelectronics.net

Last Edited: Tue. Jan 16, 2018 - 07:52 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Johan beat me to it

No he didn't. cheeky

John Samperi

Ampertronics Pty. Ltd.

www.ampertronics.com.au

* Electronic Design * Custom Products * Contract Assembly

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

Ooops, not Johan but js. Sorry!

 

Jim

Jim Wagner Oregon Research Electronics, Consulting Div. Tangent, OR, USA http://www.orelectronics.net

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

Yep, one is royalty the other hates kings.....devil

John Samperi

Ampertronics Pty. Ltd.

www.ampertronics.com.au

* Electronic Design * Custom Products * Contract Assembly

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

Thankyou Everyone!

 

I have noted one of my error I have made, which is related to clock fuse setting, I did two iterations but unsuccessful 

 

then I tried to run it with internal oscillator (I did not remove PCB tracks for external crystal oscillator)

 

 

On reset circuitry, I have 10k resistor, with 100nF cap.

On Oscillator , I have 18pF cap with 7.372800MHz crystal

 

I unchecked the CKOPT to get greater output swing for crystal, results unchanged for the checked one.

With all this, I still getting this error

 

 

 

Hello

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

I checked my Xstal2 and Xstal1 pin using oscilloscope, there is no frequency on it, All connectivity is fine.

 

Kindly, let me know if there is a way to check that Chip is alive or is deteriorated by any mishandling.

 

Thanks

 

Hello

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

Have you followed what people said and fed the chip with an external oscillator (not a crystal)? Without one you cannot change the fuses.

'This forum helps those who help themselves.'

 

pragmatic  adjective dealing with things sensibly and realistically in a way that is based on practical rather than theoretical consideration.

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

Thankyou Everyone on this forum! With your help I figured out that I wrongly  programmed the clock fuse bits, due to which the controller need TTL clock input and it was connected to crystal, So when I put external TTL clock, it was working fine, Now I reprogrammed it on factory setting and everything is working fine !

 

Regards

Hello