View previous topic :: View next topic |
Author |
Message |
Newbie Guest
|
I/O Pins and current limiting resistor |
Posted: Sat Dec 27, 2003 4:52 am |
|
|
Hi,
I want to connect a voltage between +12v and +24v to a 18F252 PIN to detect a logic high, I have been told that I can do this by simply adding a current limiting resistor, as the PIC has internal diodes that will limit the voltage.
What size resistor would I need? also is there any danger if the voltage gets any higher as these inputs will be from a car and I can envisage spikes etc.
Thx |
|
|
Humberto
Joined: 08 Sep 2003 Posts: 1215 Location: Buenos Aires, La Reina del Plata
|
|
Posted: Sat Dec 27, 2003 7:48 am |
|
|
Hi Newbie:
Read the following:
[url]
http://www.microchip.com/download/lit/pline/picmicro/families/18fxx2/39564b.pdf
[/url]
Quote: |
What size resistor would I need? also is there any danger if the voltage gets any higher as these inputs will be from a car and I can envisage spikes etc.
|
To accomodate those voltages make a resistor divider like this:
Code: |
+12V / +24V
_ _ PIC18F252
| --------------
| |
/ |
6K8 \ 20K |
/ |
| |
|---------->> |INPUT PIN
| |
/ |
\ 4K7 |
/ |
\ |
| |
| |
\/ Gnd |
------------
|
Humberto |
|
|
Newbie Guest
|
Thanks but what section..... |
Posted: Sat Dec 27, 2003 8:13 am |
|
|
Thanks for the info but that’s a large PDF and for a newbie a bit overwhelming!! can you point me to the relevant section please.
Thx |
|
|
Newbie Guest
|
Another thought |
Posted: Sat Dec 27, 2003 9:40 am |
|
|
I have a 5v 3amp reg on my circuit and need diriving from it 3.8v @ 100ma-2amp supply
Would a potential divider work for suppying this? if so what values for R1/R2. or can anyone explain how Iwork it out.
I think I can work out how to get the 3.8 volts but I'm not sure about the effects of supplying between 100ma and 2amp from this.
Thx |
|
|
Guest
|
Re: Another thought |
Posted: Sat Dec 27, 2003 12:35 pm |
|
|
Newbie wrote: | I have a 5v 3amp reg on my circuit and need diriving from it 3.8v @ 100ma-2amp supply
Would a potential divider work for suppying this? if so what values for R1/R2. or can anyone explain how Iwork it out.
I think I can work out how to get the 3.8 volts but I'm not sure about the effects of supplying between 100ma and 2amp from this.
Thx |
Simple answer. No.
A potential divider is useful, where the current down the divider is a lot higher than that into the 'load'. Hence it works nicely for the logic input (which has a leakage current of only a few uA), but is not suitable for driving a high current load.
Use another voltage regulator (something like a 1.2v design), with a potential divider from it's output, to set the 'reference' pin.
There are dozens of such circuits on the web, including data sheets for just about every adjustable regulator on the market, showing how to do this.
Best Wishes |
|
|
|