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

Transistor Switch or Relay?
Goto page Previous  1, 2
 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
wordizlife



Joined: 08 Mar 2012
Posts: 38
Location: Canada

View user's profile Send private message

PostPosted: Wed Apr 18, 2012 8:08 am     Reply with quote

I have a RFD3055LE at my disposition. This should do the trick, question is what resistance values would be needed? How do you determine the value for the pull down resistor?
asmboy



Joined: 20 Nov 2007
Posts: 2128
Location: albany ny

View user's profile Send private message AIM Address

PostPosted: Wed Apr 18, 2012 8:22 am     Reply with quote

The series gate drive resistor is there strictly for the protection of the PIC i/o driver.

The pull down is there to prevent turn on glitches and should draw less than 1 ma max current when the pic is delivering +5v. With 20k of course we are wasting only 250 ua . At power on - the pic I/Os will all be configured as inputs for a brief interval and that is enough time for the mosfet to POTENTIALLY turn on and glitch power to its load.

BTW: this floating I/O issue with driving "relays"
is a prime reason i always use #fastio
and declare OUTPUT as early as i can in my pic init code.

This may be corrected now, but in much older versions , The CCS "adjust TRIS on the fly" aspect can leave such outputs floating as inputs until the first time you do an output . This is not so cool if one of those outputs is driving a load you can't afford to glitch......

i have not bothered to test if this is handled well now because i abandoned complier auto- TRIS the first time it bit me and never looked back.

if anyone knows better please update.....
SherpaDoug



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

View user's profile Send private message

PostPosted: Wed Apr 18, 2012 8:17 pm     Reply with quote

Whether you use fast_io, fixed_io, or standard_io the output is going to float until the first output instruction to that port. And that first instruction is not going to be executed at least until the crystal is stable and RESET goes away, which can be many tens of milliseconds. That is more than enough time to do some serious damage if you have not set up pull-up resistors properly.

I would not count on anything involving software to establish a safe turn-on sequence. I have used fast_io or fixed_io very rarely in past 15 years or so I have used the CCS compiler. I recommend beginners stay with standard_io until they know they need to do something different.
_________________
The search for better is endless. Instead simply find very good and get the job done.
bkamen



Joined: 07 Jan 2004
Posts: 1615
Location: Central Illinois, USA

View user's profile Send private message

PostPosted: Wed Apr 18, 2012 8:20 pm     Reply with quote

In critical situations, I have a large resistor to transistors/MOSFETs that puts them in the (safe) condition I want at power up.

Then for the drive from the PIC to the GATE/BASE, I have a series resistor.

Good (safe) stuff...

-Ben
_________________
Dazed and confused? I don't think so. Just "plain lost" will do. :D
wordizlife



Joined: 08 Mar 2012
Posts: 38
Location: Canada

View user's profile Send private message

PostPosted: Thu Apr 19, 2012 6:00 am     Reply with quote

Well the MOSFET did the job perfectly. Thanks for the help guys!
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Goto page Previous  1, 2
Page 2 of 2

 
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