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

Discussion in 'Embedded Systems and Microcontrollers' started by bug13, Apr 6, 2012.

  1. bug13

    Thread Starter Well-Known Member

    Feb 13, 2012
    1,208
    38
    Hi I recently got a stk500 and played around with different simple code and they work fine.

    but somehow after I uploaded this code:

    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.
     
  2. kubeek

    AAC Fanatic!

    Sep 20, 2005
    4,669
    804
    You probably set the fuses wrong setting it to run off external crystal, do you have it connected?
     
  3. bug13

    Thread Starter Well-Known Member

    Feb 13, 2012
    1,208
    38
    Hi I tried both jumper setting, on-board software signal and on-board crystal signal, both doesn't work.

    is my chip fried?
     
  4. bug13

    Thread Starter Well-Known Member

    Feb 13, 2012
    1,208
    38
    additional info:

     
  5. hgmjr

    Moderator

    Jan 28, 2005
    9,030
    214
    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
     
  6. bug13

    Thread Starter Well-Known Member

    Feb 13, 2012
    1,208
    38
    Yes there are two chips with the stk500, the other chip works fine. I just want it fixed, if it's fixable
     
  7. hgmjr

    Moderator

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


    hgmjr
     
  8. bug13

    Thread Starter Well-Known Member

    Feb 13, 2012
    1,208
    38
    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?
     
  9. hgmjr

    Moderator

    Jan 28, 2005
    9,030
    214
    Set up your STK500 as shown in section in 3.7.2. and then attempt to program your sick AVR.

    hgmjr
     
  10. bug13

    Thread Starter Well-Known Member

    Feb 13, 2012
    1,208
    38
    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
     
  11. hgmjr

    Moderator

    Jan 28, 2005
    9,030
    214
    This prompts me to ask what is the difference between the codes?

    hgmjr
     
  12. bug13

    Thread Starter Well-Known Member

    Feb 13, 2012
    1,208
    38
    successful one

    Code ( (Unknown Language)):
    1. // Description: Simple C program for the ATMEL AVR uC (ATMEGA16 or ATMEGA8515 chip)
    2. // This program lets the user turn on LEDs by pressing the switches on STK500 board
    3. // Date modified: 13 May 2008
    4. #include <avr/io.h> // avr header file for IO ports
    5.  
    6. int main(void){
    7. unsigned char i; // temporary variable
    8. DDRA = 0x00; // set PORTA for input
    9. DDRB = 0xFF; // set PORTB for output
    10. PORTB = 0x01; // turn ON all LEDs initially
    11. while(1){
    12. // Read input from PORTA.
    13. // This port will be connected to the 8 switches
    14. i = PINA;
    15. // Send output to PORTB.
    16. // This port will be connected to the 8 LEDs
    17. PORTB = i;
    18. }
    19. return 1;
    20. }
    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?
     
  13. hgmjr

    Moderator

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

    Carefully check you wiring including your cabling.

    hgmjr
     
  14. bug13

    Thread Starter Well-Known Member

    Feb 13, 2012
    1,208
    38
    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:)
     
  15. hgmjr

    Moderator

    Jan 28, 2005
    9,030
    214
    I admire your persistence. That will serve you well in the future.

    hgmjr
     
  16. bug13

    Thread Starter Well-Known Member

    Feb 13, 2012
    1,208
    38
    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
     
  17. bug13

    Thread Starter Well-Known Member

    Feb 13, 2012
    1,208
    38
    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:
     
Loading...