avr Atmega128 device signature error

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

hello

I have atmega128 based board, after power on reset I can read the correct device signature (0x1E,0x97,0x02) , but one time only, the next signature read i got allows 0x00,0x01,0x02.  

in programming a got this message 

Unexpected signature 0x00000102 (expected 0x001e9702).

Unable to enter programming mode. Verify device selection, interface settings, target power, security bit, and connections to the target device.

   

same result with STK500, USBasp and PICKIT 4 

Last Edited: Tue. Jun 28, 2022 - 05:18 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

0x00,0x01,0x02 implies that your ISP programmer is faster than the mega128.   i.e. your clock fuses have changed.

 

A proper Chinese USBASP would adjust the SCK frequency automagically.

 

AS7.0 allows you to set SCK frequency to a lower value e.g. 200kHz.

 

Note that ISP shares pins with UART0.   If you have a MAX232 or USB-Serial chip connected to PE0, PE1 you should use 1k0 series resistors.

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

thank you David for the fast replay.

i have external clock 1Mhz and i already tried los ISP SCK frequency (125khz, 8khz), same problem. 

and after power on reset, i can read the correct signature the fist time.   

img1 and img2 for fist time after power-on 

img3 for other test after 

best regards 

Attachment(s): 

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

what other components are connected to the pins used for programming?

It might be that after the reset they initially will not interfere, but on the second time they might.

Best show us a schematic of the board such that we know what is going on. And with that also best include the picture as a picture in the post rather than adding it as an attachment.

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

The good news is that you have a PK4.

 

So you could program via JTAG.   (JTAGEN is factory default)

 

But personally I suspect that you have external electronics on PE0, PE1.   Or a flaky ribbon cable between AVR and PK4.

 

When you connect via JTAG please make a note of all fuses.   (preferably hex values from AS7.0)

 

David.

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

no components are connected 

Attachment(s): 

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

That's not a schematic. Where are your power connections and decoupling capacitors?

#1 Hardware Problem? https://www.avrfreaks.net/forum/...

#2 Hardware Problem? Read AVR042.

#3 All grounds are not created equal

#4 Have you proved your chip is running at xxMHz?

#5 "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."

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

I cannot remember the last time I saw a 1MHz Quartz Crystal (actually I don't think I ever have). Please check what you have fitted.

 

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

i have use external 5V, 3 capacitor of 100nf near to atmega128 

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

the quartz in schematic is 8mhz, a have used 1Mhz external clock to be sure that oscillator work because i doubted the oscillator circuit.    

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

hello every one 

thanks for all suggestions

i have use very short ISP wires, and is ok 

the problem is resolved