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

Reading 10 Bits in I/O PIN

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



Joined: 16 Jan 2005
Posts: 559
Location: Tucson, AZ

View user's profile Send private message

PostPosted: Tue Oct 03, 2006 12:23 am     Reply with quote

Don't start another post if you've already asked the same question previously....

If you're referring to reading the temp data from the LM70 you won't be reading 10 bits. Look at the timing diagrams in the data sheet and look at the way SPI works. Also, the links to other threads in your other thread may clear some things up...

You'll actually read two 8bit sequences that will have to be concatenated into a 16bit integer, of which you'll only have 10 bits of accuracy. You'll also have to deal with the 2's complement format for determining the sign of the value.

From what you have asked, it appears that you aren't up to writing your own drivers yet. Look for another digital temperature sensor that has a driver already written for it.....

John
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Tue Oct 03, 2006 1:39 am     Reply with quote

Quote:
How can i read 10 bits in PIN RA0 ?

Look at the CCS example files that read in bits from an A/D converter:

c:\program files\picc\drivers\ltc1298.c
and
c:\program files\picc\drivers\mcp3208.c
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