| Author |
Message |
mamhosney
Joined: 04 Jan 2005 Posts: 21
|
10 Jan 2005 9:20 retlw const data |
|
|
|
|
| i want a topic or site explain how to build a look up table in atmel 89c51 pls reply me fast
|
|
| Back to top |
|
 |
Antharax
Joined: 01 Jan 1970 Posts: 227 Helped: 13
|
10 Jan 2005 9:57 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
|
|
| Back to top |
|
 |
nj_jack
Joined: 09 Nov 2004 Posts: 90
|
16 Jan 2005 3:53 look up table (LUT) |
|
|
|
|
| you can create an data array, which can make your program speed. This is a convenient method.
|
|
| Back to top |
|
 |
banh
Joined: 16 Dec 2004 Posts: 472 Helped: 12
|
16 Jan 2005 4:41 Re: look up table (LUT) |
|
|
|
|
| mamhosney wrote: |
| 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.)? ...
|
|
| Back to top |
|
 |
boeysue
Joined: 23 Dec 2004 Posts: 190 Helped: 3
|
21 Jan 2005 22:09 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.
|
|
| Back to top |
|
 |
mamhosney
Joined: 04 Jan 2005 Posts: 21
|
04 May 2005 13:09 Re: look up table (LUT) |
|
|
|
|
| thanks for all ,i have designed my LUT and it worked well
|
|
| Back to top |
|
 |
Badaruddin
Joined: 25 Jan 2005 Posts: 32
|
04 May 2005 16:38 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.
|
|
| Back to top |
|
 |
Google AdSense

|
04 May 2005 16:38 Ads |
|
|
|
|
|
|
| Back to top |
|
 |
ahmad_abdulghany
Joined: 12 Apr 2005 Posts: 1369 Helped: 212 Location: Cairo, Egypt
|
04 May 2005 16:58 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 ..
|
|
| Back to top |
|
 |
Badaruddin
Joined: 25 Jan 2005 Posts: 32
|
11 May 2005 5:27 Re: look up table (LUT) |
|
|
|
|
| It is not 89c51 assembly language.
|
|
| Back to top |
|
 |
eng_ahmed22
Joined: 07 Jun 2005 Posts: 178 Helped: 13
|
21 Feb 2006 8:11 Re: look up table (LUT) |
|
|
|
|
| Badaruddin wrote: |
| It is not 89c51 assembly language. |
i think it is PIC code, in assembly.
|
|
| Back to top |
|
 |