View previous topic :: View next topic |
Author |
Message |
jspencer
Joined: 22 Dec 2003 Posts: 57 Location: Boise, ID USA
|
MCP9700 C library |
Posted: Fri Aug 11, 2006 12:56 pm |
|
|
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
|
|
Posted: Fri Aug 11, 2006 5:29 pm |
|
|
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
|
|
Posted: Mon Aug 14, 2006 8:54 am |
|
|
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
|
Help with temperature using mcp9700 |
Posted: Tue Apr 17, 2012 2:13 pm |
|
|
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 |
|
|
|