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

MCP9700 C library

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



Joined: 22 Dec 2003
Posts: 57
Location: Boise, ID USA

View user's profile Send private message

MCP9700 C library
PostPosted: Fri Aug 11, 2006 12:56 pm     Reply with quote

I'm looking at using the MCP9700. Does anyone know if there is a C library already out there that has been written? It can be in either CCS C or Microchip C. I've got the one in assembly and just wanting to know if there is a better starting point out there. If not then I'll just port the assembly code.

Thanks,

jspencer
kender



Joined: 09 Aug 2004
Posts: 768
Location: Silicon Valley

View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger

PostPosted: Fri Aug 11, 2006 5:29 pm     Reply with quote

From what I could understand from the MCP9700 datasheet, it’s an analog sensor. So if you know how to read the A/D on a PIC, you can get the reading with just a few lines of code.
Code:

// assuming that the A/D is set up already
int16 iReading;
set_adc_channel(YOUR_MCP9700_CHANNEL); // switch the A/D channel
delay_us(10); // give the mux some time to settle
iReading = read_adc(); // get the reading from the A/D

Well, this could be a starting point. Look up also the code for LM35 temperature sensor in the forum. It’s another analog temperature sensor similar to MCP9700.
jspencer



Joined: 22 Dec 2003
Posts: 57
Location: Boise, ID USA

View user's profile Send private message

PostPosted: Mon Aug 14, 2006 8:54 am     Reply with quote

Thanks for the info and taking the time to look at the datasheet. I should have been a little more specific in what I was looking for. I was looking for the calibration and temperature compensation routines. I think that I got most of it ported to C now from the assembly, just need to run some tests and make sure that everything is working as I would expect.

Thanks,

jspencer
Darkforces



Joined: 16 Apr 2012
Posts: 8

View user's profile Send private message

Help with temperature using mcp9700
PostPosted: Tue Apr 17, 2012 2:13 pm     Reply with quote

jspencer wrote:
Thanks for the info and taking the time to look at the datasheet. I should have been a little more specific in what I was looking for. I was looking for the calibration and temperature compensation routines. I think that I got most of it ported to C now from the assembly, just need to run some tests and make sure that everything is working as I would expect.

Thanks,

jspencer


Hi,

Can you help me with your docs about temperature measurements with mcp9700? If possible send me by email.
Thanks,

Darkforces
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