Page 1 of 1

Look Up Table - Size of elements

Posted: Fri Mar 19, 2021 2:19 pm
by George_B
Hi,

I have a question about the size of LUT in FC7.

Would it be possible to store large quantities of data such as 50000 elements as integers in first LUT
and another 50000 as float in a second LUT. :?

At the moment as far as i tested the component, it accepts approximately 6000 values.



Best Regards
George

Re: Look Up Table - Size of elements

Posted: Fri Mar 19, 2021 2:24 pm
by kersing
The amount of elements you can add to a LUT depends on the microcontroller you want to use. For 8 bit pic 50000 would be a huge amount and I don’t thing it can be done. For int alone that would be 100000 flash positions in flash.

Re: Look Up Table - Size of elements

Posted: Fri Mar 19, 2021 2:40 pm
by George_B
kersing wrote:
Fri Mar 19, 2021 2:24 pm
The amount of elements you can add to a LUT depends on the microcontroller you want to use. For 8 bit pic 50000 would be a huge amount and I don’t thing it can be done. For int alone that would be 100000 flash positions in flash.
Thanks for your comment. I checked the LUT component again using larger memory and 16bit mcu but the maximum elements i can paste in are 6221.

So i hope it will be another way( maybe define the LUT in supplementary code) to support more elements in the table.


George

Re: Look Up Table - Size of elements

Posted: Fri Mar 19, 2021 9:20 pm
by George_B
just an update after some time trying different things..


I created 6 LUT droping 6 different components in my project's panel.

I then paste on each table the 4000 values. So in total i have 25000 values in those 6 LUT !

I compile the project and the result of the used space was amazingly vesy small!
Screenshot_1.jpg
Screenshot_1.jpg (16.06 KiB) Viewed 24227 times
:shock:


So now i am almost sure that the memory space is enough for holding the two LUT that i want to have (25000 elements on each table).

Do you think that there is any way of writing 25000 element in one LUT and not seperate the values in quantities of 6000 or less? :roll:


Thanks in advance!

George

Re: Look Up Table - Size of elements

Posted: Fri Mar 19, 2021 9:36 pm
by kersing
This doesn’t make sense. If you have 4000 elements of 1 byte (let alone a larger integer) you need 4000 memory locations to store those values. None of the memory allocations in your output has 6 times 4000 elements = 24000 elements allocated. My guess is the lookup tables are truncated or the optimizer got rid of them (do you access any elements in your code?)

Re: Look Up Table - Size of elements

Posted: Fri Mar 19, 2021 9:58 pm
by George_B
kersing wrote:
Fri Mar 19, 2021 9:36 pm
This doesn’t make sense. If you have 4000 elements of 1 byte (let alone a larger integer) you need 4000 memory locations to store those values. None of the memory allocations in your output has 6 times 4000 elements = 24000 elements allocated. My guess is the lookup tables are truncated or the optimizer got rid of them (do you access any elements in your code?)

I thing you are right. In the simulation i can access all the elements of any of 6 LUT. After i checked the C code produced from the compiled project i realized that there are only the elements of the first LUT! The other 5 are mising from the code..




Flowcode8.c
(39.48 KiB) Downloaded 151 times

Re: Look Up Table - Size of elements

Posted: Sat Mar 20, 2021 2:06 pm
by George_B
I focused on the solution to my problem and not so much on how to write huge tables in the microcontroller.
Therefore i am wondering if it is good idea to use an external EEPROM chip to do the job. With what characteristics should i choose the EEPROM chip in order to be able to holt the amount of data i want?