Hello
I am using a 24FV16KA304 device with FC7 and am not able to get my look-up table to work on hardware. It does work perfectly however in simulation.
I have stored about 1100 numbers in the range 1727 to 29271 using the LUT macro.
There is a compiler warning stating that these values are truncated to UINT. I should not have thought it a problem as my numbers are in that range and it is what the macro requires and the chip ROM is 16 bit anyway. Please correct me if I am wrong.
During simulation the loop exits with the correct value but on hardware the loop does not exit unless I force it to escape. My uninformed guess is that the numbers are not stored in ROM correctly.
Any ideas?
Howard
LUT only works in simulation
Moderator: Benj
- LeighM
- Matrix Staff
- Posts: 2178
- Joined: Tue Jan 17, 2012 10:07 am
- Has thanked: 481 times
- Been thanked: 699 times
- Contact:
Re: LUT only works in simulation
Hi,
The problem is that the LUT component is generating a byte array for the target ROM, so the integers are limited to 255.
Looks like we need to add a property to set the bit width.
In the meantime I have a workaround that should give you what you want.
You will need to add this simulation icon into the start of your main ...
Then use the simulation "step" button to step over this icon, that will force the component into 16 bit integer mode.
Then you can compile to chip.
Or to avoid having to remember to run the icon, and if you are feeling adventurous, create a Compile Start event macro ...
The problem is that the LUT component is generating a byte array for the target ROM, so the integers are limited to 255.
Looks like we need to add a property to set the bit width.
In the meantime I have a workaround that should give you what you want.
You will need to add this simulation icon into the start of your main ...
Then use the simulation "step" button to step over this icon, that will force the component into 16 bit integer mode.
Then you can compile to chip.
Or to avoid having to remember to run the icon, and if you are feeling adventurous, create a Compile Start event macro ...
-
- Posts: 75
- Joined: Thu May 24, 2012 1:15 pm
- Location: Cape Town
- Has thanked: 30 times
- Been thanked: 28 times
- Contact:
Re: LUT only works in simulation
Thanks
The first method worked. No more truncation messages and hence a fast compile. The second method, which would be more convenient, did not work.
Would you mind having a look at what I have done and correct as necessary.
Hope you can fix this sometime.
regards
Howard
The first method worked. No more truncation messages and hence a fast compile. The second method, which would be more convenient, did not work.
Would you mind having a look at what I have done and correct as necessary.
Hope you can fix this sometime.
regards
Howard
- LeighM
- Matrix Staff
- Posts: 2178
- Joined: Tue Jan 17, 2012 10:07 am
- Has thanked: 481 times
- Been thanked: 699 times
- Contact:
Re: LUT only works in simulation
Updated project attached ...
- Attachments
-
- LUT test high res 03.fcfx
- (21.3 KiB) Downloaded 272 times
-
- Posts: 75
- Joined: Thu May 24, 2012 1:15 pm
- Location: Cape Town
- Has thanked: 30 times
- Been thanked: 28 times
- Contact:
Re: LUT only works in simulation
Thanks that has worked.
It has used a considerable amount of program store - 4290 bytes. Are the LUT integers being declared as UINT32?
thanks
It has used a considerable amount of program store - 4290 bytes. Are the LUT integers being declared as UINT32?
thanks
- Benj
- Matrix Staff
- Posts: 15312
- Joined: Mon Oct 16, 2006 10:48 am
- Location: Matrix TS Ltd
- Has thanked: 4803 times
- Been thanked: 4314 times
- Contact:
Re: LUT only works in simulation
Here is an updated LUT component with a user configurable data type, this should allow you to select exactly which data type you want to use.
If you have a go with it then please let me know how you get on.
Simply copy the attached file to your "Flowcode 7/Components" directory and restart Flowcode for the changes to be loaded.
If you have a go with it then please let me know how you get on.
Simply copy the attached file to your "Flowcode 7/Components" directory and restart Flowcode for the changes to be loaded.
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel