Forum Menu




 


Log in Problems?
New User? Sign Up!
AVR Freaks Forum Index

Post new topic   Reply to topic
View previous topic Printable version Log in to check your private messages View next topic
Author Message
robototechnik
PostPosted: Feb 12, 2013 - 11:22 PM
Newbie


Joined: Jan 27, 2013
Posts: 17


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.
 
 View user's profile Send private message  
Reply with quote Back to top
js
PostPosted: Feb 13, 2013 - 01:59 AM
10k+ Postman


Joined: Mar 28, 2001
Posts: 22850
Location: Sydney, Australia (Gum trees, Koalas and Kangaroos, No Edelweiss)

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
 
 View user's profile Send private message Visit poster's website 
Reply with quote Back to top
robototechnik
PostPosted: Feb 13, 2013 - 08:45 AM
Newbie


Joined: Jan 27, 2013
Posts: 17


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.
 
 View user's profile Send private message  
Reply with quote Back to top
westfw
PostPosted: Feb 13, 2013 - 09:32 AM
Posting Freak


Joined: Jun 19, 2002
Posts: 1472
Location: SF Bay area

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.
 
 View user's profile Send private message  
Reply with quote Back to top
robototechnik
PostPosted: Feb 13, 2013 - 09:53 AM
Newbie


Joined: Jan 27, 2013
Posts: 17


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.
 
 View user's profile Send private message  
Reply with quote Back to top
mikericetga
PostPosted: Feb 13, 2013 - 11:20 AM
Hangaround


Joined: Jul 29, 2012
Posts: 148
Location: Southwest Florida USA

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.
 
 View user's profile Send private message  
Reply with quote Back to top
robototechnik
PostPosted: Feb 13, 2013 - 11:47 AM
Newbie


Joined: Jan 27, 2013
Posts: 17


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=)
 
 View user's profile Send private message  
Reply with quote Back to top
david.prentice
PostPosted: Feb 13, 2013 - 11:55 AM
10k+ Postman


Joined: Feb 12, 2005
Posts: 20707
Location: Wormshill, England

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.
 
 View user's profile Send private message Send e-mail  
Reply with quote Back to top
clawson
PostPosted: Feb 13, 2013 - 11:56 AM
10k+ Postman


Joined: Jul 18, 2005
Posts: 71918
Location: (using avr-gcc in) Finchingfield, Essex, England

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.

_________________
 
 View user's profile Send private message  
Reply with quote Back to top
robototechnik
PostPosted: Feb 13, 2013 - 12:17 PM
Newbie


Joined: Jan 27, 2013
Posts: 17


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
Code:

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.
 
 View user's profile Send private message  
Reply with quote Back to top
david.prentice
PostPosted: Feb 13, 2013 - 12:21 PM
10k+ Postman


Joined: Feb 12, 2005
Posts: 20707
Location: Wormshill, England

Code:

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.
 
 View user's profile Send private message Send e-mail  
Reply with quote Back to top
robototechnik
PostPosted: Feb 13, 2013 - 12:48 PM
Newbie


Joined: Jan 27, 2013
Posts: 17


OK Ive tried to connect ATtiny 2313 with this code.

Code:

#include <avr/io.h>            
#include <avr/delay.h>         
#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....).
 
 View user's profile Send private message  
Reply with quote Back to top
clawson
PostPosted: Feb 13, 2013 - 01:08 PM
10k+ Postman


Joined: Jul 18, 2005
Posts: 71918
Location: (using avr-gcc in) Finchingfield, Essex, England

In AS6 your code generates:
Code:
   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 <main+0x4>

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.

_________________
 
 View user's profile Send private message  
Reply with quote Back to top
david.prentice
PostPosted: Feb 13, 2013 - 01:15 PM
10k+ Postman


Joined: Feb 12, 2005
Posts: 20707
Location: Wormshill, England

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.
 
 View user's profile Send private message Send e-mail  
Reply with quote Back to top
robototechnik
PostPosted: Feb 13, 2013 - 02:10 PM
Newbie


Joined: Jan 27, 2013
Posts: 17


Ok, may be I have measured wrong, sorry=)
It should even with 111 kHz, shouldnt it?
 
 View user's profile Send private message  
Reply with quote Back to top
robototechnik
PostPosted: Mar 06, 2013 - 03:04 PM
Newbie


Joined: Jan 27, 2013
Posts: 17


i have replaced this chip with a new one and it works wothout problems=)bad chip=)
 
 View user's profile Send private message  
Reply with quote Back to top
Display posts from previous:     
Jump to:  
All times are GMT + 1 Hour
Post new topic   Reply to topic
View previous topic Printable version Log in to check your private messages View next topic
Powered by PNphpBB2 © 2003-2006 The PNphpBB Group
Credits