|
|
View previous topic :: View next topic |
Author |
Message |
davt
Joined: 07 Oct 2003 Posts: 66 Location: England
|
Table returning 3 values |
Posted: Fri Mar 26, 2004 9:12 am |
|
|
Good day
I am using a 16f876 and want to set up a look up table in program memory using the result of the internal a/d converter ( 8 bit ) to index the table - but instead of the table retrning one value I need three.
Also I will be exeeding the 128 limit I need 256 how do I get round this?
Int8 const [ CCS limit max 128] {,,,,,}
Hope I am making sense!
Thanks
Dave |
|
|
John P
Joined: 17 Sep 2003 Posts: 331
|
|
Posted: Fri Mar 26, 2004 2:07 pm |
|
|
The "obvious" way is to divide each of your 3 lookup tables into a "high" and a "low" segment, and look up one byte from either the high or the low segment in sequence, three times. You'd decide which one to use by testing the high bit of your argument, and use the low 7 bits for an actual index.
The less-obvious but more interesting way is to write the data into the hex file at a known starting address and then use the read_program_eeprom() command to get the data back. With this procedure there's no limit on the size of your array, and each data element can have 14 bits. But I don't think CCS allows you any way to write data to the hex file the way you need it, so it can be tedious to get it loaded. Does anyone know an easy way to do this? |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|