It is currently 20 Oct 2018 05:08

All times are UTC + 1 hour




Post new topic Reply to topic  [ 5 posts ] 
Author Message
 Post subject: sink/source output
PostPosted: 22 May 2017 09:41 
Offline

Joined: 06 Mar 2017 08:57
Posts: 8
how do user select weather he/she wants sink or source output.
I wish to directly sink 5V from the base of PNP and don't know how to program that.


Top
 Profile  
 
 Post subject: Re: sink/source output
PostPosted: 22 May 2017 23:50 
Offline

Joined: 18 Feb 2006 13:17
Posts: 4983
mija.strnad wrote:
how do user select weather he/she wants sink or source output.
Most PIC processors have only push-pull outputs and no way to reconfigure them to only sink or only source current.
Quote:
I wish to directly sink 5V from the base of PNP and don't know how to program that.
I cannot say that I know what you mean by 'directly sink 5V from the base of PNP' :( . Assuming that you want to control a PNP transistor that has emitter connected to processor's Vdd, you need current-limiting resistor from its base to one of processor's outputs.

_________________
Replacement libraries for mP PRO and PIC18 processors, mP PRO tips & trics


Top
 Profile  
 
 Post subject: Re: sink/source output
PostPosted: 23 May 2017 09:47 
Offline

Joined: 06 Mar 2017 08:57
Posts: 8
I need internal circuity of pic for i/o. If pin is set to output via tris register when logic 1 pin is connected to vdd where does it connect when logic 0. Will at logic 0 pin sink current or not? And yes i know you have to limit current on the outputs. So if i have pnp emitor to vdd and base goes through 1k resistor to pic's input will it switch load on logic 0?


Top
 Profile  
 
 Post subject: Re: sink/source output
PostPosted: 23 May 2017 12:16 
Offline

Joined: 18 Feb 2006 13:17
Posts: 4983
mija.strnad wrote:
I need internal circuity of pic for i/o. If pin is set to output via tris register when logic 1 pin is connected to vdd where does it connect when logic 0. Will at logic 0 pin sink current or not?
Yes, it will. That's why it's called push-pull output - output is forced either to Vdd or to Vss (ground).
Quote:
And yes i know you have to limit current on the outputs. So if i have pnp emitor to vdd and base goes through 1k resistor to pic's input will it switch load on logic 0?
Yes. How big a load will depend on transistor's amplification coefficient. (For light loads, say up to 50mA, you should not need lower resistance than 4.7k - even for worst signal transistors.)

_________________
Replacement libraries for mP PRO and PIC18 processors, mP PRO tips & trics


Top
 Profile  
 
 Post subject: Re: sink/source output
PostPosted: 23 May 2017 13:13 
Offline

Joined: 06 Mar 2017 08:57
Posts: 8
thanks. That is what I needed...


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 3 guests


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 post attachments in this forum

Search for:
Jump to: