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
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
Bye
Ben Zijlstra
http://members.home.nl/bzijlstra
"Matt Smith" <gizmo...@hotmail.com> schreef in bericht
news:10173635...@nnrp2.phx1.gblx.net...
> 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/
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