View previous topic :: View next topic |
Author |
Message |
kiuFelix
Joined: 25 Apr 2012 Posts: 2 Location: Nairobi,Kenya
|
|
|
Mike Walne
Joined: 19 Feb 2004 Posts: 1785 Location: Boston Spa UK
|
|
Posted: Wed Apr 25, 2012 3:00 pm |
|
|
What else is available to you?
R,C,L,OPA etc ?
Mike |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Wed Apr 25, 2012 3:13 pm |
|
|
Change the PIC to a 16F88, 16F818, or 16F819. They all have an A/D
converter, and they are all in the same 18-pin package as the 16F628.
Or, use a different temperature chip. Use a chip with an i2c interface
such as ds1621. CCS has a driver file for that chip (ds1621.c) so it's
easy to use. |
|
|
kiuFelix
Joined: 25 Apr 2012 Posts: 2 Location: Nairobi,Kenya
|
Thanks |
Posted: Fri Apr 27, 2012 10:59 pm |
|
|
Thank you all for quick reply. Great information. I got 16F88 and it works great. I appreciate your efforts. Thanks again. _________________ Think.Code.Coffee |
|
|
Mike Walne
Joined: 19 Feb 2004 Posts: 1785 Location: Boston Spa UK
|
|
Posted: Mon Apr 30, 2012 10:46 am |
|
|
If you want to measure negative temperature connect LM35 as:-
Code: |
----------- Analogue Input
------- |
| | |
----| LM35 |----WWWW--
| | | |
| ------- |
| | |
| | |
5V ----WWWW-----------WWWW------- GND
R1 R2
|
Don't forget to decouple LM35.
Choose R1, R2 to give an R1/R2 junction voltage of 500 - 1000mV.
You will need to correct LM35 output voltage to compensate for GND offset.
Do this either by calculating from R1, R2 values or by measuring with another A2D channel.
Mike |
|
|
Gabriel
Joined: 03 Aug 2009 Posts: 1067 Location: Panama
|
|
Posted: Mon Jun 04, 2012 7:54 am |
|
|
Hi!
I'm using a 16F88 and an LM35 as well in my project.
My LM35 circuit is exactly as Figure 7 on page 7/13 of the datasheet
https://www.national.com/ds/LM/LM35.pdf
I'm reading Out+ on AN0 and Out- on AN1.
LM35 is fed/powered via a charge pump (running on pin RA7)outputting 9.20V stable, no ripple (i have an O-scope).
When i read the output with my DMM i get a nice 30C temp reading (as it should be (Panama is hot).
My ADC reads 0 on both inputs...
Can you post your adc code?
Thanks
G. _________________ CCS PCM 5.078 & CCS PCH 5.093 |
|
|
|