CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to support@ccsinfo.com

Table returning 3 values

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
davt



Joined: 07 Oct 2003
Posts: 66
Location: England

View user's profile Send private message

Table returning 3 values
PostPosted: Fri Mar 26, 2004 9:12 am     Reply with quote

Good day Very Happy

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

View user's profile Send private message

PostPosted: Fri Mar 26, 2004 2:07 pm     Reply with quote

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?
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
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