ATmega 1284P signature does not match selected device!

Last post
16 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hello!
I have got a selfmade robot with ATmega 32A. Everything worked very good without any problems. But I have had not enough RAM on it for the RTOS. I decided to replace ATmega 32A with ATmega 1284P. ATmega 32A has only 2kB RAM instead of 16kB on ATmega 1284P. In the datasheet Ive found that the pins of both chips are the same. I dont need to make another board. After replacing I am not able to connect with the chip. The signature does not match selected device! The bytes were read as 0x00 0x00 0x00. The fuses and erase function are also disabled. The ISP frequency is already 6,48 kHz. I have tried with 125 kHz and so on, it doesnt work at all. I am using 20 MHz crystal. I have also tried to run the chip with the 16 MHz crystal and with external signal to the XTAL1 pin, from other chip.
I am using AVR Studio 4.18 with AVR ISP mkii.
Does anybody know the reason?
Regards.

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

Quote:
The ISP frequency is already 6,48 kHz
Far too LOW.
Quote:
I have tried with 125 kHz
Did you WRITE the value after changing it? This should work at all times.
Quote:
I am using 20 MHz crystal
Were the fuses set for the crystal before things stopped working?

Did you rebuild the code for the M1284?

John Samperi

Ampertronics Pty. Ltd.

www.ampertronics.com.au

* Electronic Design * Custom Products * Contract Assembly

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

The ISP frequency 6,48 kHz should work! It works with my ATtiny 2313 for example.
Of cource I did! =)But it doesnt work.
No, I didnt changed the fuses because from the beginning I cannot contact the chip. I am not trying to program the chip, I just want to read the signature and the fuses! And the after changing the fuses I will cahge the code and so on. I dont know witch clocking source is chosen in the chip. Even when there is RC internal oscillator, it should work, I have already tried to disconnect the 20 MHz crystal. Whene there is external crystal, then it should also work, I have tried with 16 and 20 MHz. Today I want to try also with 1, 4 and 8 MHz crystals. I have also tried with external signal generator. Does not work. It cannot read the fuses, erase the chip, read signature.
Very strange...
Regards.

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

Do you have access to a parallel programmer?
Chips are supposed to come in a state that is ready-to-ISP, but it's possible that yours is somehow set for something else (JTAG?)
Does the programmer software you're using have a verbose mode? Generally getting a zero signature indicates some pretty substantial wiring error, but reading the signature is not the first thing that should be happening. It would mean "something" (I'm not sure what) if you were getting a valid response to the "enter programming mode" command, but nothing else.

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

No, I havent. How could it set for JTAG?? All the ATmegas should work with ISP from the beginning, am I right?
What is verbose mode? I am using original AVR Studio 4.18. The programmer is AVR ISP mkii.
Ill write once again from the beginning what happens when I am connection the programmer to the chip.
So after connecting the cable the LED indicator on the programmer is green, it means that the chip is connected right and he is found. Then I choose in the device list ATmega 1284P and trying to read the signture with different frequencies. The signature is 0x00 0x00 0x00 and of cource WARNING! The signature doesnt match the selected device. Ok, When am trying to read the fuses or erase device it always shows the same ISP mode error.

Setting mode and device parameters.. OK!
Entering programming mode.. FAILED!
Leaving programming mode.. OK!

And the error with quick tips, how to low the frequency of ISP and so on.
The VTarget is 5 volt.
What is more, after the error in the fuse section there is no SPIEN fise set, but how could it be known when the programmer unabl to read the fuses?
Regards.

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

Put your 32A back in and try to read the sig.

If you can read the 32A, you've proven the wiring is OK, and the 1284 has a problem.

If you can't read the 32A, you probably have something loading the SPI or the Reset pins.

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

The first circuit was with ATmega 32A, everything was ok. I hav eread the signature, fuses and so on. Than I have made another one circuit, every detail is the same excepr the chip.
May be Ive bought bad chip? I have another one and I will try to build one more circuit. Becyuse I cannot desolder the chip withit damages=)

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

If you have soldered the chip, I would try everything else before unsoldering it.

1. Study your soldering with a magnifying glass (like Sherlock Holmes)
2. Post photos of both boards. Perhaps readers have better eyesight. Believe me, it is easy to miss things.
3. Read clawson's Tutorial for recovering chips. e.g. apply external clock to XTAL1 pin.

David.

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

1284s are notorious when being used with fast crystals. If it's fused for a crystal it MUSt use "full swing" mode or it won't work which could well be what's going on here. Use the recovery technique shown in my tutorial forum thread then repair the fuse setting.

 

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

david.prentice,
Ive already studied every connection of the ATmega abd other details, I have also studied everything with the multimeter, ive found nothing. I have tried to study the signals from MOSI, MISO, SCK and RESET on the pins of chip with my oszilloscope. Everything is fine.
clawson, Ive already tried to connect an extarnal clock source from ATtiny 2313, the same situation =(
Ive wrote something like this for ATtiny

PORTB|= _BV(PB0);			
_delay_ms(100);			
PORTB &= ~_BV(PB0);		
_delay_ms(100);	

and put this pin to the XTAL1 of the ATmega, unfortunatelly it doesnt olve my problem =(
Is in this way the chip bad???
Regards.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0
PORTB|= _BV(PB0);         
_delay_ms(100);         
PORTB &= ~_BV(PB0);      
_delay_ms(100); 

Are you taking the p*ss ?

How do you expect a 20MHz chip to run at 5Hz? (0.000005MHz)

Read Cliff's tutorial carefully. Follow its advice.

David.

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

OK Ive tried to connect ATtiny 2313 with this code.

#include 				
#include 			
#define F_CPU 10000000			

int main(void)  {	 
  DDRB = 0xFF;  
while(1)
{   
PORTB ^= 0xFF; 
}
}
	

The pin I connected to the XTAL1 of ATmega. I have mesuared the frequency of the signal. On the pin of ATtiny there is 0.999 kHz and on the XTAL1 there is...250 kHz. The same problem...unable to contact the chip =(
Regards.
PS I have already recovered ATtiny 2313 with such a signal(i mean 5 Hz....).

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

In AS6 your code generates:

	DDRB = 0xFF;
  5a:	8f ef       	ldi	r24, 0xFF	; 255
  5c:	87 bb       	out	0x17, r24	; 23
	while(1)
	{
		PORTB ^= 0xFF;
  5e:	88 b3       	in	r24, 0x18	; 24
  60:	80 95       	com	r24
  62:	88 bb       	out	0x18, r24	; 24
  64:	fc cf       	rjmp	.-8      	; 0x5e 

IN, COM, OUT are 1 cycle, RJMP is 2 cycles. An OUT will therefore occur every 5 cycles. At 1MHz that is 5us. To make a full wave it has to cycle the loop twice so that is 10us. So on a 1MHz chip that code will produce a 100kHz signal. If you measured 0.999kHz I'm going to suggest you mis-read what the measuring device was telling you. Sure it might be 99.9kHz but not 0.999kHz.

 

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

Please make an effort to write something believable.

A 1MHz tiny2313 will produce a square wave of 111kHz.
An 8MHz tiny2313 - 888kHz.

Read Cliff's tutorial. You can get 8MHz directly from the CKOUT pin.

David.

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

Ok, may be I have measured wrong, sorry=)
It should even with 111 kHz, shouldnt it?

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

i have replaced this chip with a new one and it works wothout problems=)bad chip=)