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.

How to build a look up table in Atmel 89c51?

Status
Not open for further replies.

mamhosney

Junior Member level 1
Joined
Jan 4, 2005
Messages
15
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
137
retlw const data

i want a topic or site explain how to build a look up table in atmel 89c51 pls reply me fast
 

Antharax

Full Member level 4
Joined
Dec 31, 1999
Messages
208
Helped
14
Reputation
28
Reaction score
1
Trophy points
1,298
Activity points
2,865
Re: look up table (LUT)

in what language?
C, Assembler, ...

And when you have questions about microcontrollers, please post them in the Microcontrollers section!

lookuptables can be made like this in C (one of many possible ways)
Code:
const unsigned int MyLookupTable[] = { 0x0022, 0x8844, 0x8982, 0x8d94 }
MyLookupTable[1] will give you 0x8844

but please check where the compiler puts the const data (it can be in rom or in ram). Also check the size of an int for your compiler (most uC have a 16 bit integer but it can also be 32 bit like most PC's)

Antharax
 

nj_jack

Member level 5
Joined
Nov 9, 2004
Messages
87
Helped
1
Reputation
2
Reaction score
0
Trophy points
1,286
Activity points
725
look up table (LUT)

you can create an data array, which can make your program speed. This is a convenient method.
 

banh

Advanced Member level 1
Joined
Dec 16, 2004
Messages
458
Helped
17
Reputation
34
Reaction score
5
Trophy points
1,298
Activity points
3,937
Re: look up table (LUT)

mamhosney said:
i want a topic or site explain how to build a look up table in atmel 89c51 pls reply me fast


lookup table can be easily built using array declaration.

you may need to consider a few more things such as: in ROM or RAM (i.e. is it updateable?), at which address (the address in some cases can help you access the table conveniently.)? ...
 

boeysue

Full Member level 3
Joined
Dec 23, 2004
Messages
188
Helped
3
Reputation
6
Reaction score
0
Trophy points
1,296
Activity points
1,523
Re: look up table (LUT)

First you should tell us the function of your look-up table.
Then other will be easiear to help u.
 

mamhosney

Junior Member level 1
Joined
Jan 4, 2005
Messages
15
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
137
Re: look up table (LUT)

thanks for all ,i have designed my LUT and it worked well
 

Badaruddin

Member level 1
Joined
Jan 25, 2005
Messages
32
Helped
1
Reputation
2
Reaction score
1
Trophy points
1,288
Activity points
276
Re: look up table (LUT)

I don't know the site, but i suggest you learn instructions about :

1. label
2. movc a,@a+dptr
3. memory locations

It is usefull to built LUT.
 

ahmad_abdulghany

Advanced Member level 4
Joined
Apr 12, 2005
Messages
1,209
Helped
102
Reputation
206
Reaction score
21
Trophy points
1,318
Location
San Jose, California, USA
Activity points
11,775
Re: look up table (LUT)

If you want to make a LUT you can use Assembly language like the following :
assume you want to do LUT for sine wave generation , then you will call a subroutine that takes the required value of sine and moves it to the program counter register PCL then it will jump to certain address that corresponds to the called value then returns with literal value stored in the Working register ...

like that :
label :
..... ; here you will transfer the input value that you need to get its sin
movfw input
call sin
....

sin :
movwf PCL
retlw .1 ; scaled value of the sin output ...
retlw .2
retlw .3
retlw .4
.....

I hope that Helped you ... :)
If you needed anything else or didn't understand what i said .. please PM me ..
 

Badaruddin

Member level 1
Joined
Jan 25, 2005
Messages
32
Helped
1
Reputation
2
Reaction score
1
Trophy points
1,288
Activity points
276
Re: look up table (LUT)

It is not 89c51 assembly language.
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Top