Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

ATTiny2313 AVR program error: OUT sph, r16

Status
Not open for further replies.

computer eng.

Junior Member level 2
Joined
Mar 6, 2009
Messages
20
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,422
Hello everyone ..

I'm try to test my IC with a simple program ..
But when I build this program in AVR studio 4 it gives me an error in the instruction : OUT sph,r16

Can anyone tell me what's the problem, or giva another simple program


/// The program
.include "tn2313def.inc"
.org 0x0000
rjmp main

main:
ldi r16, low(RAMEND)
out SPL, r16
ldi r16, high(RAMEND)
/// Error here :
out SPH, r16

ldi r16, 0xFF
out DDRB, r16
loop:
sbi PortB, 3
rcall delay_05
cbi PortB, 3
rcall delay_05
rjmp loop

delay_05:
ldi r16, 8
outer_loop:

ldi r24, low(3037)
ldi r25, high(3037)
delay_loop:
adiw r24, 1
brne delay_loop

dec r16
brne outer_loop
ret


..

I need your helping guys ..

..
 

avr program

The ATTiny2313 only has 128 bytes of RAM, so it does not need a 16-bit register to access that. Therefore it does not have an SPH register, which is why you are getting the error. Comment out those lines that initialize SPH.
 
avr delay_loop

Ahaaaaaaaaa


Thanks alot VVV for your reply..
 

simple avr programs

If I want to use AT90S2313..

What is the file to be included at the begining of the code ..?
 

simple avr

computer eng. said:
If I want to use AT90S2313..

What is the file to be included at the begining of the code ..?

Code:
.include "2313def.inc"
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top