stk500, at90s8515, "lock out", beginner first screwed up

Thread Starter

bug13

Joined Feb 13, 2012
2,002
Hi I recently got a stk500 and played around with different simple code and they work fine.

but somehow after I uploaded this code:

#include <avr/io.h>

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

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

return 1;​
}
the chip stop working, avrdude give:

D:\>avrdude -c usbtiny -p at90s8515 -U flash:w:test.
hex

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

And I find this, my chip could be lock out, and it said it can be fix with STK500, but I don't know how to do it exactly.
 

Thread Starter

bug13

Joined Feb 13, 2012
2,002
You probably set the fuses wrong setting it to run off external crystal, do you have it connected?
Hi I tried both jumper setting, on-board software signal and on-board crystal signal, both doesn't work.

is my chip fried?
 

Thread Starter

bug13

Joined Feb 13, 2012
2,002
additional info:

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.
 

hgmjr

Joined Jan 28, 2005
9,027
I suggest you hang on to the device that is not programming. I suspect that the fuse that selects the clock source has been programmed to select an external clock.

The STK500 should have come with a couple of sample AVR's.

hgmjr
 

Thread Starter

bug13

Joined Feb 13, 2012
2,002
I suggest you hang on to the device that is not programming. I suspect that the fuse that selects the clock source has been programmed to select an external clock.

The STK500 should have come with a couple of sample AVR's.

hgmjr
Yes there are two chips with the stk500, the other chip works fine. I just want it fixed, if it's fixable
 

hgmjr

Joined Jan 28, 2005
9,027
Try setting up the STK500 for high voltage programming mode. It is described in the manual for the STK500


hgmjr
 

Thread Starter

bug13

Joined Feb 13, 2012
2,002
Try setting up the STK500 for high voltage programming mode. It is described in the manual for the STK500
hgmjr
My laptop doesn't have a serial or parallel port, I am using a usb to serial converter, as I understand it, my setup doesn't support high voltage programming right?
 

hgmjr

Joined Jan 28, 2005
9,027
My laptop doesn't have a serial or parallel port, I am using a usb to serial converter, as I understand it, my setup doesn't support high voltage programming right?
Set up your STK500 as shown in section in 3.7.2. and then attempt to program your sick AVR.

hgmjr
 

Thread Starter

bug13

Joined Feb 13, 2012
2,002
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
 

hgmjr

Joined Jan 28, 2005
9,027
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
This prompts me to ask what is the difference between the codes?

hgmjr
 

Thread Starter

bug13

Joined Feb 13, 2012
2,002
successful one

Rich (BB code):
// Description: Simple C program for the ATMEL AVR uC (ATMEGA16 or ATMEGA8515 chip)
// This program lets the user turn on LEDs by pressing the switches on STK500 board
// Date modified: 13 May 2008
#include <avr/io.h> // avr header file for IO ports

int main(void){
unsigned char i; // temporary variable
DDRA = 0x00; // set PORTA for input
DDRB = 0xFF; // set PORTB for output
PORTB = 0x01; // turn ON all LEDs initially
while(1){
// Read input from PORTA.
// This port will be connected to the 8 switches
i = PINA;
// Send output to PORTB.
// This port will be connected to the 8 LEDs
PORTB = i;
}
return 1;
}
Then I simply change the input from PORTA to PORTD, can't upload the code anymore, even I copy and paste the original code and rebuild, still doesn't work. They both build all right with no warnings.

I mean even the code is wrong, I should still able to upload the code right?
 

hgmjr

Joined Jan 28, 2005
9,027
The symptom you are seeing points to an intermittent connection somewhere in you circuit.

Carefully check you wiring including your cabling.

hgmjr
 

Thread Starter

bug13

Joined Feb 13, 2012
2,002
I rebuild the same code for atmega16, same wiring(no change), and test it on atmega16, it works fine.

I think I really screwed my chip, or if any other reason(let's hope it's not my board that is broken), I have wasted enough time on this, better off buying another chip (too bad at90s8515 not available any more)

thank you guys for helping on this, time to wrap it up:)
 

Thread Starter

bug13

Joined Feb 13, 2012
2,002
Anyway I gave it one more go on a breadboard, just the chip and the programmer(power through the programmer), nothing more, no luck.

the good thing is, my stk500 properly is still good
 

Thread Starter

bug13

Joined Feb 13, 2012
2,002
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:mad:
 
Top