# Converting simple code, AT90S1200 > 90S2313 or ATTiny2313

Status
Not open for further replies.

#### RevZ

##### Newbie level 3
Hi, I've got a little problem that needs solving

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

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
;loop here or exit, whatever
PLEASE Remember the "helped Me" button!

### RevZ

Points: 2

#### RevZ

##### Newbie level 3
Thank you very much! I clicked the button for you

Status
Not open for further replies.