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 support@ccsinfo.com

Regarding i/o port question

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



Joined: 15 Dec 2006
Posts: 109

View user's profile Send private message

Regarding i/o port question
PostPosted: Fri Mar 10, 2017 4:06 am     Reply with quote

Hi all,

I would like to know if whether i can feed 5V in i/o pin configured as a input without a resistor in between.

Thanks and Regards,
Jai.
RF_Developer



Joined: 07 Feb 2011
Posts: 839

View user's profile Send private message

PostPosted: Fri Mar 10, 2017 5:26 am     Reply with quote

Simple answer: Yes, generally.

Longer answer: on 5V PICs powered from 5V, which is most of the time on 10, 12, 16 and 18 series PICs, yes, no problem. On PICs powered from lower voltages, e.g. 3.3V, then maybe yes, often no. This depends on whether the input is 5V tolerant, as is the case on many IO pins on many 24s (possibly dspics and 33s but I have no practical experience of those). Not all 24 series IO pins are 5V tolerant!

So, in a 5V application, yes, you can wire IO pins directly to the supply. You can even drive them a little (no more than 0.2-0.3V generally) above the supply rail - read the datasheet carefully - but this is NOT advised. This can happen when an analogue source, operating off higher voltage than the PIC, is used to drive an IO pin. Excess current in this mode can cause unexpected, incorrect operation, such as incorrect ADC readings, restarts, lock-ups and in some cases damage to the PIC.

What's the reason for this? A common mistake is to try and drive a 3.3V peripheral with a 5V PIC, but that's the other way round to this. It is sometimes possible (I'm doing it) to drive a 5V peripheral with a 3.3V PIC, provided the input lines are 5V tolerant and the Voh/Vih and Vol/Vil specs are compatible.
jaikumar



Joined: 15 Dec 2006
Posts: 109

View user's profile Send private message

PostPosted: Fri Mar 10, 2017 5:43 am     Reply with quote

Thank you.
Ttelmah



Joined: 11 Mar 2010
Posts: 19255

View user's profile Send private message

PostPosted: Fri Mar 10, 2017 6:22 am     Reply with quote

and also there is the issue that if you direct connect to another 5v source, and then the PIC power goes 'off', your circuit can end up powering itself off this signal....
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