Yahoo Groups archive

AVR-Chat

Index last updated: 2026-04-28 22:41 UTC

Thread

Problem During ISP Programming

Problem During ISP Programming

2008-03-06 by Rakesh Modi

I am using stk500 kit from atmel and avr studio for wrting a code.
In my code when i am calling subroutine more than 1 time then i can 
not download a program. It gives me an error of clock frequency. I am 
sending my code below. please help me. 

include "m16def.inc"
LDI R16, 0X5F
OUT SPL, R16
LDI R16, 0X08
OUT SPH, R16
HERE:
LDI R17, 0XFF
OUT DDRA, R17
LDI R17, 0XFF
OUT PORTA,R17
nop
CALL DELAY
CALL DELAY
LDI R17, 0XFF
OUT DDRA, R17
LDI R17, 0XFE
OUT PORTA,R17
NOP
CALL DELAY
CALL DELAY
CALL DELAY
NOP
RJMP HERE
DELAY:
LDI R19, 0Xff
w:ldi R18, 0Xff
XY:DEC R18
CPI R18, 0X00
BRNE XY
DEC R19
CPI R19, 0X00
BRNE W
RET

Re: [AVR-Chat] Problem During ISP Programming

2008-03-06 by Roy E. Burrage

It might be easier for you to trace your program flow if you would 
comment your code, even for a small program like this one.  You'll 
likely also see your problem.


REB


Rakesh Modi wrote:
Show quoted textHide quoted text
> I am using stk500 kit from atmel and avr studio for wrting a code.
> In my code when i am calling subroutine more than 1 time then i can 
> not download a program. It gives me an error of clock frequency. I am 
> sending my code below. please help me. 
>
> include "m16def.inc"
> LDI R16, 0X5F
> OUT SPL, R16
> LDI R16, 0X08
> OUT SPH, R16
> HERE:
> LDI R17, 0XFF
> OUT DDRA, R17
> LDI R17, 0XFF
> OUT PORTA,R17
> nop
> CALL DELAY
> CALL DELAY
> LDI R17, 0XFF
> OUT DDRA, R17
> LDI R17, 0XFE
> OUT PORTA,R17
> NOP
> CALL DELAY
> CALL DELAY
> CALL DELAY
> NOP
> RJMP HERE
> DELAY:
> LDI R19, 0Xff
> w:ldi R18, 0Xff
> XY:DEC R18
> CPI R18, 0X00
> BRNE XY
> DEC R19
> CPI R19, 0X00
> BRNE W
> RET
>
>
>

Re: [AVR-Chat] Problem During ISP Programming

2008-03-06 by John Samperi

At 08:43 PM 6/03/2008, you wrote:
>  It gives me an error of clock frequency.

This has NOTHING to do with your code. You have the ISP
frequency set too high. Set it for 250KHz and WRITE it.


Regards

John Samperi

********************************************************
Ampertronics Pty. Ltd.
11 Brokenwood Place Baulkham Hills, NSW 2153 AUSTRALIA
Tel. (02) 9674-6495       Fax (02) 9674-8745
Email: john@ampertronics.com.au
Website  http://www.ampertronics.com.au
*Electronic Design * Custom Products * Contract Assembly
********************************************************

Move to quarantaine

This moves the raw source file on disk only. The archive index is not changed automatically, so you still need to run a manual refresh afterward.