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

array reading error

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



Joined: 22 Aug 2005
Posts: 275

View user's profile Send private message

array reading error
PostPosted: Tue Jul 25, 2006 9:48 am     Reply with quote

Hi everybody,

I want to read a table as show
Quote:


const signed int16 tabella_pt100[6][2]=
{
{0x0002,0x001C}, // 2°
{0x002d,0x03B7}, // 45°
{0x0062,0x07FC}, // 98°
{0x00C8,0x0FF1}, // 200°
{0x012c,0x1743}, // 300°
{0x015e,0x1ADF}, // 350°
};

int16 converti_lettura_ad_temperatura(int16 lettura_ad){

int i;
int16 t1;
int16 t2;
int16 delta_ad;
int16 delta_t;

for (i=1;i<6;i++){
t1=tabella_pt100[i-1][1];
t2=tabella_pt100[i-1][1];
}
}


This is only a part of routine but the problem is in reading array.

I don't realize why in first step t1=0x001C and t2=0x181C.

When I enter in the routine t1=0 but t2=0x1B00.

I'm using PIC16F690 and Compiler V 3.235

I used, without any problem, the same routine with PIC16F876A.
Thanks for support,
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