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

16F628 has no ADC. How to use LM35 ?

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



Joined: 25 Apr 2012
Posts: 2
Location: Nairobi,Kenya

View user's profile Send private message Visit poster's website

16F628 has no ADC. How to use LM35 ?
PostPosted: Wed Apr 25, 2012 4:45 am     Reply with quote

Hi everyone. I am new in CCS and I think I am running the same problem in PIC16F628.
I need help please. Thanks.
Check out my issue posted in www.edaboard.com http://www.edaboard.com/thread249842.html#post1068773
_________________
Think.Code.Coffee
Mike Walne



Joined: 19 Feb 2004
Posts: 1785
Location: Boston Spa UK

View user's profile Send private message

PostPosted: Wed Apr 25, 2012 3:00 pm     Reply with quote

What else is available to you?

R,C,L,OPA etc ?

Mike
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Wed Apr 25, 2012 3:13 pm     Reply with quote

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

View user's profile Send private message Visit poster's website

Thanks
PostPosted: Fri Apr 27, 2012 10:59 pm     Reply with quote

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

View user's profile Send private message

PostPosted: Mon Apr 30, 2012 10:46 am     Reply with quote

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

View user's profile Send private message

PostPosted: Mon Jun 04, 2012 7:54 am     Reply with quote

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
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