Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Getting a lookup table into the Atmel 8515

43 views
Skip to first unread message

Matt Smith

unread,
Mar 28, 2002, 7:56:40 PM3/28/02
to
Greetings all!

I'm just getting started with assembly programming in general and have come
across the need to put some numbers in the Eprom of the Atmel 8515 to use as
a look-up table. I'm using AVR Studio 3.22 which has the option to write a
hex file to the chip's eprom. Unfortunately, I can't get the table to
compile into hex format since it is just a bunch of hex values (not
instructions) - I just get a bunch of errors.

Here's an excerpt of the file:

$01
$03
$07
$0f
$10
$11
$13
$17

I want to get those (and more like them) into the 8515 Eprom. Anybody know
the trick to doing this? Thanks!

-Matt


Ashok Mahadevan

unread,
Mar 28, 2002, 8:14:43 PM3/28/02
to
Did you try this?

Table: .db 0x01, 0x03, 0x07, 0x0F ....

You can then use the index registers to fetch bytes from the table:

ldi ZH, high(2*Table)
ldi ZL, low(2*Table)
lpm

this will load the byte pointed to by the 16-bit register combination made of
ZH:ZL into register R0 (0x01 in this case).

Hope this helps.

-Ashok

Ben Zijlstra

unread,
Mar 29, 2002, 4:01:02 PM3/29/02
to
Check www.mcselec.com for a demo of Bascom-AVR
You could do it in Basic

Bye
Ben Zijlstra
http://members.home.nl/bzijlstra

"Matt Smith" <gizmo...@hotmail.com> schreef in bericht
news:10173635...@nnrp2.phx1.gblx.net...

Christopher X. Candreva

unread,
Mar 30, 2002, 9:47:13 PM3/30/02
to
"Matt Smith" <gizmo...@hotmail.com> schreef in bericht

> I'm just getting started with assembly programming in general and have


> come across the need to put some numbers in the Eprom of the Atmel 8515 to
> use as a look-up table. I'm using AVR Studio 3.22 which has the option to
> write a hex file to the chip's eprom. Unfortunately, I can't get the
> table to compile into hex format since it is just a bunch of hex values
> (not instructions) - I just get a bunch of errors.

I use the gcc tools under Linux, not AVR Studio, BUT the general idea you
probably want to look for is a constant definition. That would be where to
look.

Under GCC, you generat separate .hex file for the flash and the EEPROM, and
then upload/program each into your chip. I expect there is a similar
procedure under AVR Studio.

--
==========================================================
Chris Candreva -- ch...@westnet.com -- (914) 967-7816
WestNet Internet Services of Westchester
http://www.westnet.com/

PeterK

unread,
Apr 2, 2002, 3:43:17 AM4/2/02
to

"Matt Smith" <gizmo...@hotmail.com> wrote in message
news:10173635...@nnrp2.phx1.gblx.net...

> Greetings all!
>
> I'm just getting started with assembly programming in general and have
come
> across the need to put some numbers in the Eprom of the Atmel 8515 to use
as
> a look-up table. I'm using AVR Studio 3.22 which has the option to write
a
> hex file to the chip's eprom. Unfortunately, I can't get the table to
> compile into hex format since it is just a bunch of hex values (not
> instructions) - I just get a bunch of errors.
>
> Here's an excerpt of the file:
[snip]

I think the other people have been sidetracked. Did you want to do this?

; How to do an EEPROM table
.ESEG
.ORG $000
MyTable: .DB $01, $03, $07, $0f, $10, $11, $13, $17
.DB " .....more data in strings if you want"
.CSEG
; .....more code

; regards, Peter


0 new messages