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.

Converting simple code, AT90S1200 > 90S2313 or ATTiny2313

Status
Not open for further replies.

RevZ

Newbie level 3
Joined
Jan 24, 2009
Messages
4
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,318
Hi, I've got a little problem that needs solving :D

It's about a simple code, which I've attached in this post. It's originally for the AT90S1200, which isn't available anymore for years here now. I've read things about the AT90S2313 and ATTiny2313 being pin compatible to each other, so I was wondering if the code could be used or in a way converted so that I can use one of those chips, which I can both still easily get nowadays.. Can someone help me with this?

Thanks in advance for the help!

Kevin.
 

ctownsend

Advanced Member level 2
Joined
Nov 27, 2004
Messages
575
Helped
93
Reputation
188
Reaction score
63
Trophy points
1,308
Location
Canada
Activity points
3,677
Re: Converting simple code, AT90S1200 > 90S2313 or ATTiny

Here it is. Working and assembled.
look at the new asm file. I documented the changes. Normally you would not use the eeprom for tables (I wouldn't).Another way would be to move the table into the code segment and use the lpm instruction like so:
Code:
	ldi	ZH,high(table*2)    ;address of the table
	ldi	ZL,low(table*2)

;you can add an offset to ZL if you want to specify a specific address like so:
        adiw ZL,4                      ;go to the 4rth byte in the table
TableLp:
	lpm                               ;get byte
	mov  temp,R0                ;copy to temp
	adiw	ZL,1                      ;increment address (if needed)
;loop here or exit, whatever
PLEASE Remember the "helped Me" button!
 

    RevZ

    Points: 2
    Helpful Answer Positive Rating

RevZ

Newbie level 3
Joined
Jan 24, 2009
Messages
4
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,318
Thank you very much! I clicked the button for you ;)
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Top