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

producing and importing look up tables

 
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

producing and importing look up tables
PostPosted: Wed Oct 20, 2004 9:32 am     Reply with quote

Hi all

Often I need to have look up tables in my projects. How can I produce them to be in a suitable form to import into CCS.
If someone could take me through the stages...
Thanks

Embarassed

Dave
Neutone



Joined: 08 Sep 2003
Posts: 839
Location: Houston

View user's profile Send private message

Re: producing and importing look up tables
PostPosted: Wed Oct 20, 2004 10:26 am     Reply with quote

davt wrote:
Hi all

Often I need to have look up tables in my projects. How can I produce them to be in a suitable form to import into CCS.
If someone could take me through the stages...
Thanks

Embarassed

Dave


Generate a comma delimited text file and then copy and paste

Code:
/* Table of CRC values for high order byte */
char Table_CRC_Hi[256] = {                                  // A global stored in RAM is faster than a constant by 50%
//const char Table_CRC_Hi[256] = {
0x00, 0xC1, 0x81, 0x40, 0x01, 0xC0, 0x80, 0x41, 0x01, 0xC0, 0x80, 0x41, 0x00, 0xC1, 0x81,
0x40, 0x01, 0xC0, 0x80, 0x41, 0x00, 0xC1, 0x81, 0x40, 0x00, 0xC1, 0x81, 0x40, 0x01, 0xC0,
0x80, 0x41, 0x01, 0xC0, 0x80, 0x41, 0x00, 0xC1, 0x81, 0x40, 0x00, 0xC1, 0x81, 0x40, 0x01,
0xC0, 0x80, 0x41, 0x00, 0xC1, 0x81, 0x40, 0x01, 0xC0, 0x80, 0x41, 0x01, 0xC0, 0x80, 0x41,
0x00, 0xC1, 0x81, 0x40, 0x01, 0xC0, 0x80, 0x41, 0x00, 0xC1, 0x81, 0x40, 0x00, 0xC1, 0x81,
0x40, 0x01, 0xC0, 0x80, 0x41, 0x00, 0xC1, 0x81, 0x40, 0x01, 0xC0, 0x80, 0x41, 0x01, 0xC0,
0x80, 0x41, 0x00, 0xC1, 0x81, 0x40, 0x00, 0xC1, 0x81, 0x40, 0x01, 0xC0, 0x80, 0x41, 0x01,
0xC0, 0x80, 0x41, 0x00, 0xC1, 0x81, 0x40, 0x01, 0xC0, 0x80, 0x41, 0x00, 0xC1, 0x81, 0x40,
0x00, 0xC1, 0x81, 0x40, 0x01, 0xC0, 0x80, 0x41, 0x01, 0xC0, 0x80, 0x41, 0x00, 0xC1, 0x81,
0x40, 0x00, 0xC1, 0x81, 0x40, 0x01, 0xC0, 0x80, 0x41, 0x00, 0xC1, 0x81, 0x40, 0x01, 0xC0,
0x80, 0x41, 0x01, 0xC0, 0x80, 0x41, 0x00, 0xC1, 0x81, 0x40, 0x00, 0xC1, 0x81, 0x40, 0x01,
0xC0, 0x80, 0x41, 0x01, 0xC0, 0x80, 0x41, 0x00, 0xC1, 0x81, 0x40, 0x01, 0xC0, 0x80, 0x41,
0x00, 0xC1, 0x81, 0x40, 0x00, 0xC1, 0x81, 0x40, 0x01, 0xC0, 0x80, 0x41, 0x00, 0xC1, 0x81,
0x40, 0x01, 0xC0, 0x80, 0x41, 0x01, 0xC0, 0x80, 0x41, 0x00, 0xC1, 0x81, 0x40, 0x01, 0xC0,
0x80, 0x41, 0x00, 0xC1, 0x81, 0x40, 0x00, 0xC1, 0x81, 0x40, 0x01, 0xC0, 0x80, 0x41, 0x01,
0xC0, 0x80, 0x41, 0x00, 0xC1, 0x81, 0x40, 0x00, 0xC1, 0x81, 0x40, 0x01, 0xC0, 0x80, 0x41,
0x00, 0xC1, 0x81, 0x40, 0x01, 0xC0, 0x80, 0x41, 0x01, 0xC0, 0x80, 0x41, 0x00, 0xC1, 0x81,
0x40
} ;
Mark



Joined: 07 Sep 2003
Posts: 2838
Location: Atlanta, GA

View user's profile Send private message Send e-mail

PostPosted: Wed Oct 20, 2004 10:29 am     Reply with quote

Here is an example of a lookup table.

Code:
UINT16 const INCANDESCENT_CURVE_60Hz[102] = {
     0x5161,0x5161,0x4A26,0x4909,0x4721,0x4604,0x44E7,0x441C,0x42FF,0x4285,
     0x4191,0x4117,0x4074,0x3FFA,0x3F57,0x3E8C,0x3E11,0x3D97,0x3CF5,0x3C7B,
     0x3C01,0x3B5E,0x3ABB,0x3A18,0x399E,0x3924,0x38AA,0x37DF,0x373C,0x36C2,
     0x3648,0x35CE,0x352B,0x34B1,0x33E5,0x3394,0x32C8,0x324E,0x31D4,0x3132,
     0x30B8,0x3015,0x2F9B,0x2EF8,0x2EA7,0x2E04,0x2D8A,0x2CE7,0x2C96,0x2BF3,
     0x2B79,0x2AFF,0x2AAD,0x2A33,0x29E2,0x293F,0x28C5,0x284B,0x27D1,0x2757,
     0x2705,0x26B4,0x2611,0x25C0,0x2546,0x24F4,0x247A,0x2400,0x2386,0x230C,
     0x22BB,0x2241,0x21C7,0x214D,0x20D3,0x2058,0x1FDE,0x1F64,0x1EC2,0x1E47,
     0x1DA5,0x1D2B,0x1C88,0x1C0E,0x1B6B,0x1AC8,0x1A26,0x1983,0x18E0,0x183D,
     0x1772,0x16A6,0x15B2,0x1495,0x13A1,0x1284,0x11B9,0x1022,0x0E11,0x0B5D,
     0x0000};


This was created with Excel and a VB Macro.
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