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

12VDC sensor to PIC port

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



Joined: 25 Sep 2003
Posts: 7
Location: Uniontown, PA

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

12VDC sensor to PIC port
PostPosted: Mon Mar 15, 2004 3:17 pm     Reply with quote

I have a sensor that produces a 0 or 12VDC signal. What is the best way to normalize this signal for input to the PIC for HI-LOW state detection?

Thanks!
_________________
Greg
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Mon Mar 15, 2004 3:21 pm     Reply with quote

Voltage divider. Or, if you have a spare receiver input on a
MAX232, you could use that.
gbaugh



Joined: 25 Sep 2003
Posts: 7
Location: Uniontown, PA

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

PostPosted: Mon Mar 15, 2004 3:26 pm     Reply with quote

The freq on the line will be <= 20KHz. Are there problems using a voltage div. in the form of a resistor in line with the port and another to ground?
_________________
Greg
SherpaDoug



Joined: 07 Sep 2003
Posts: 1640
Location: Cape Cod Mass USA

View user's profile Send private message

PostPosted: Mon Mar 15, 2004 3:27 pm     Reply with quote

Microchip AP note AP521 is a great intro to interfacing odd voltages to PIC pins. Definately worth a read.
_________________
The search for better is endless. Instead simply find very good and get the job done.
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Mon Mar 15, 2004 6:25 pm     Reply with quote

Quote:
The freq on the line will be <= 20KHz. Are there problems using a
voltage div. in the form of a resistor in line with the port and another
to ground?

Let's say you use a 3.3K series resistor, followed by a 2.2K to ground.
The output of that circuit goes to a digitial input pin on the PIC.
The period of a 20 KHz signal is 50 usec. A half-cycle is 25 usec.
The input capacitance of the PIC pin is probably 5 to 10 pf.
Let's say the rise time will be 5 RC time constants.
The rise time might be around 100 ns. That's not a problem.
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