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
bug13avr
PostPosted: Apr 06, 2012 - 11:31 AM
Hangaround


Joined: Mar 18, 2012
Posts: 138


Hi I am new to MCU, recently I got a stk500 and tried a few different code on it, all working fine except I uploaded the following code and it stopped working:

Code:
int main(void)
{
  // Set Port B pins as all outputs
  DDRB = 0xff;

  // Set all Port B pins as HIGH
  PORTB = 0xff;

  return 1;
}


I always get RC=-1 from avrdude.

Quote:
avrdude: initialization failed, rc=-1
Double check connections and try again, or use -F to override
this check.


According to http://www.avrfreaks.net/index.php?name=PNphpBB2&file=viewtopic&t=106325, I could have lock out my chip.

Can someone explain to me how to fix it, thanks
 
 View user's profile Send private message  
Reply with quote Back to top
david.prentice
PostPosted: Apr 06, 2012 - 11:39 AM
10k+ Postman


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

Your program is fine.

None of the LEDs are lit.

You must write 0 to light an LED on the STK500. It is known as 'active-low'.

Have you really got an AT90S8515 ?
That chip is obsolete. However it should still work ok for that program.

David.
 
 View user's profile Send private message Send e-mail  
Reply with quote Back to top
JohanEkdahl
PostPosted: Apr 06, 2012 - 12:20 PM
10k+ Postman


Joined: Mar 27, 2002
Posts: 18545
Location: Lund, Sweden

Did you mess with the clock selection fuses?
 
 View user's profile Send private message Visit poster's website 
Reply with quote Back to top
clawson
PostPosted: Apr 06, 2012 - 02:12 PM
10k+ Postman


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

Quote:

Have you really got an AT90S8515 ?

Also note that the STK500 used to ship with a mega8515 not an AT90S8515 so it seems unlikely it is an AT90S8515.

Anyway the AT90S8515 always required an external clock but the good news is that the STK500 is always in a position to supply one so I don't see how one could ever really "lose it"? Just ensure that the STK500 is jumpered to deliver its clock to the right pin.

_________________
 
 View user's profile Send private message  
Reply with quote Back to top
RickB
PostPosted: Apr 06, 2012 - 04:35 PM
Resident


Joined: Jan 30, 2005
Posts: 852
Location: Junction City, OR USA

Quote:
Also note that the STK500 used to ship with a mega8515 not an AT90S8515 so it seems unlikely it is an AT90S8515.


Early STK500s (my first one) shipped with AT90S8515. A second one had the ATmega8515L.
 
 View user's profile Send private message  
Reply with quote Back to top
bug13avr
PostPosted: Apr 06, 2012 - 09:32 PM
Hangaround


Joined: Mar 18, 2012
Posts: 138


david.prentice wrote:


Have you really got an AT90S8515 ?
That chip is obsolete.

David.


it looks like I am the few lucky one to get send a old stock Shocked
 
 View user's profile Send private message  
Reply with quote Back to top
bug13avr
PostPosted: Apr 06, 2012 - 09:35 PM
Hangaround


Joined: Mar 18, 2012
Posts: 138


JohanEkdahl wrote:
Did you mess with the clock selection fuses?


I have read about it and all tutorial advice not to touch any fuses setting for beginner, so I didn't change any things with the word "fuse" on it
 
 View user's profile Send private message  
Reply with quote Back to top
bug13avr
PostPosted: Apr 06, 2012 - 09:38 PM
Hangaround


Joined: Mar 18, 2012
Posts: 138


clawson wrote:

Anyway the AT90S8515 always required an external clock but the good news is that the STK500 is always in a position to supply one so I don't see how one could ever really "lose it"? Just ensure that the STK500 is jumpered to deliver its clock to the right pin.


after the incident, I have changed the OSCSEL jumper to all the possible connection(on-board software signal, on-board crystal signal, not connected at all), still nothing.
 
 View user's profile Send private message  
Reply with quote Back to top
bug13avr
PostPosted: Apr 06, 2012 - 09:49 PM
Hangaround


Joined: Mar 18, 2012
Posts: 138


So did I just fried my first chip? Shocked

Is there anything I can do to fix it?

Or should I turn the chip into this http://www.crookedbrains.net/2007/02/ic-old-transistors-got-new-use.html Laughing
 
 View user's profile Send private message  
Reply with quote Back to top
bug13avr
PostPosted: Apr 06, 2012 - 09:51 PM
Hangaround


Joined: Mar 18, 2012
Posts: 138


additional info:

Code:
c:/>avrdude -c usbtiny -p at90s8515 -e -F

avrdude: initialization failed, rc=-1
avrdude: AVR device initialized and ready to accept instructions
avrdude: Device signature = 0x000000
avrdude: Yikes!  Invalid device signature.
avrdude: Expected signature for AT90S8515 is 1E 93 01

avrdude done.  Thank you.
 
 View user's profile Send private message  
Reply with quote Back to top
david.prentice
PostPosted: Apr 06, 2012 - 11:48 PM
10k+ Postman


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

The 8515 should be in SKT30000D3.
OSCSEL should be 1-2

Set the programmable clock to 3.6MHz in the HW Settings tab of Studio Programmer.

Set programmable VCC to 5V.

The underneath of your STK500 shows all the default jumper positions.

Believe me. Nothing is broken. Probably just a wrong setting.

David.
 
 View user's profile Send private message Send e-mail  
Reply with quote Back to top
bug13avr
PostPosted: Apr 07, 2012 - 05:02 AM
Hangaround


Joined: Mar 18, 2012
Posts: 138


david.prentice wrote:
The 8515 should be in SKT30000D3.
OSCSEL should be 1-2
The underneath of your STK500 shows all the default jumper positions.

David.


Hi David

I have moved the chip from SCKT3100A3 to SCKT3000D3, all the leds light up when I press reset. (nothing happen when the chip is in SCKT3100A3)

all my jumper is the default positions.

Quote:
Set the programmable clock to 3.6MHz in the HW Settings tab of Studio Programmer.

Set programmable VCC to 5V.


I don't think I can do these setting as I am still waiting for my usb serial cable to show up.

I tried to program it anyway after I moved the chip but still same error

Quote:
Believe me. Nothing is broken. Probably just a wrong setting.


Good to hear that Laughing
 
 View user's profile Send private message  
Reply with quote Back to top
david.prentice
PostPosted: Apr 07, 2012 - 08:26 AM
10k+ Postman


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

If you have got an old-stock STK500, it would have come with a green A5 paper manual. Read it while you are waiting for the mail to deliver your Serial cable.

Until you get the cable, the STK500 is fairly helpless.
All the same, I suspect that a virgin STK500 comes with VCC and Clock set to 5V and 3.6MHz.

So your TinyISP should be able to program the 8515. However it is a little more complicated to use an external programmer. e.g. do not supply power from the TinyISP.

David.

If your STK500 was very old stock, it might even have a 5V DataFlash chip near the PROGRAM button.
 
 View user's profile Send private message Send e-mail  
Reply with quote Back to top
bug13avr
PostPosted: Apr 07, 2012 - 10:27 AM
Hangaround


Joined: Mar 18, 2012
Posts: 138


david.prentice wrote:

All the same, I suspect that a virgin STK500 comes with VCC and Clock set to 5V and 3.6MHz.

So your TinyISP should be able to program the 8515. However it is a little more complicated to use an external programmer. e.g. do not supply power from the TinyISP.

David.

If your STK500 was very old stock, it might even have a 5V DataFlash chip near the PROGRAM button.


here are some picture of my stk500, I think it was made in 2004:
http://www.box.com/s/0e0657559003e7a001e9
http://www.box.com/s/c6d3632dbf209e77f80c

power was not supplied to the stk500, that was something you advised to me not to do in the other post, thanks David.

guess I will need to wait for my serial usb cable and tried your method.

James
 
 View user's profile Send private message  
Reply with quote Back to top
david.prentice
PostPosted: Apr 07, 2012 - 10:42 AM
10k+ Postman


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

Your TinyISP should be able to read the chip.

Connect to the RED 6-pin header according to the ISP pin-out in your green manual.

How did you get such a old stock ?

It looks as if pin#1 is not seated correctly in the SKT30000D3 socket.
You do not have a DataFlash chip.

David.
 
 View user's profile Send private message Send e-mail  
Reply with quote Back to top
bug13avr
PostPosted: Apr 08, 2012 - 05:18 AM
Hangaround


Joined: Mar 18, 2012
Posts: 138


I have successfully program the chip twice today with default setting, and the chip working as expected, but then when I tried another code later, the chip just don't want to be program, weird!

No setting have changed

the voltage supply to the chip is 4.95v, is it suppose to be 5.0v? the power to the stk500 is 12v 600mA
 
 View user's profile Send private message  
Reply with quote Back to top
david.prentice
PostPosted: Apr 08, 2012 - 08:13 AM
10k+ Postman


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

I assume that you are using 'avrdude -c usbtiny'

Please quote your actual command(s)

We can't really do anything more than guesswork.
I presume that your serial cable was not in Saturday's mail. Perhaps it will arrive on Tuesday.

4.95V is fine.

David.
 
 View user's profile Send private message Send e-mail  
Reply with quote Back to top
bug13avr
PostPosted: Apr 08, 2012 - 11:50 AM
Hangaround


Joined: Mar 18, 2012
Posts: 138


david.prentice wrote:
I assume that you are using 'avrdude -c usbtiny'

Please quote your actual command(s)


the command is:

Code:
avrdude -c usbtiny -p at90s8515 -U flash:w:test.hex
 
 View user's profile Send private message  
Reply with quote Back to top
bug13avr
PostPosted: Apr 14, 2012 - 05:20 AM
Hangaround


Joined: Mar 18, 2012
Posts: 138


My serial to usb cable finally arrived today, and I managed to program the chip through serial high voltage programming, the chip is finally fixed.

but no support for at90s8515 in AVR Studio 5.1, bummer

_________________
Zhuhua Wu - Electronic Engineering Student
 
 View user's profile Send private message  
Reply with quote Back to top
david.prentice
PostPosted: Apr 14, 2012 - 08:30 AM
10k+ Postman


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

You must have a lousy postal service in your country !

You will probably never get support in Studio 5.1
Buy a new chip(s).

Seriously, you should have got the 90S8515 working without HVPP.

It will take you a while to get used to all the facilities of your STK500. It is an excellent piece of kit.

David.
 
 View user's profile Send private message Send e-mail  
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