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 CCS Technical Support

make8 usage

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








make8 usage
PostPosted: Tue Oct 10, 2006 6:15 am     Reply with quote

can anybody see what i am doing wrong down here.

i am tring to store a 16bit number in eeprom by splitting it using make8, so i tried the following;

Code:


int MSB, LSB
INT16 ADC

MSB = make8(ADC,0);
LSB = make8(ADC,1);

printf(lcd_putc("%UL-%U-%U",ADC,MSB,LSB));



the output from the above code will be;

ADC = 1320
MSB = 40
LSB = 5

Can anybode see why i am getting some strange numbers here??

Thanks, Nick
JPA
Guest







PostPosted: Tue Oct 10, 2006 8:58 am     Reply with quote

You inverted MSB and LSB... See compiler function references for the use of make8.
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