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

RB5 Pin output high too low

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



Joined: 23 Apr 2005
Posts: 73

View user's profile Send private message Send e-mail AIM Address

RB5 Pin output high too low
PostPosted: Wed May 25, 2005 8:05 pm     Reply with quote

I am trying to drive a solid state relay that is rated at 3-32VDC and 20mA using pin RB5. It doesn't work, and I checked my output voltage using a DMM on the pin and I am getting 2.4 volts from RB7 to VSS (GND). Should I use a pullup resistor to Vdd (Maybe 1.7k?) to get the output above 3V or maybe tie 2 output pins together in series and send this to the relay? Is there an easier way to do this, and is this a standard output for RB5 (On the spec sheets I remember reading somewhere that Voh for I/O pins should be around Vdd - 0.7V so I'm not sure why I'm getting only 2.4V)?

By the way, I'm using a PIC18LF1320.
newguy



Joined: 24 Jun 2004
Posts: 1903

View user's profile Send private message

PostPosted: Wed May 25, 2005 8:29 pm     Reply with quote

What is your supply voltage (what voltage is the pic running at)?

Kind of sounds like the pic can't drive enough current. Maybe try hooking the SSR's "coil" up via a transistor and instead drive the transistor - use that to turn it on.
Bryan



Joined: 23 Apr 2005
Posts: 73

View user's profile Send private message Send e-mail AIM Address

PostPosted: Wed May 25, 2005 8:37 pm     Reply with quote

My supply voltage is 5V Vdd, so it should be enough and the pics I/O pins are rated for 25mA so it should theoretically be enough, but who knows in practice...
newguy



Joined: 24 Jun 2004
Posts: 1903

View user's profile Send private message

PostPosted: Wed May 25, 2005 8:56 pm     Reply with quote

I know about the 25 mA/pin, but I wouldn't trust it. In theory, a chevy sprint should be able to hit 120 mph too, but probably only if it was going down a really long, steep hill. Smile

I wouldn't want to be in the car for the attempt either.
asmallri



Joined: 12 Aug 2004
Posts: 1634
Location: Perth, Australia

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

PostPosted: Thu May 26, 2005 12:57 am     Reply with quote

Some solid state relays are poorly rated in terms of the input. Some are TTL level inputs but a lot are simply a diode forming half of an internal optocoupler. In this case you would need a series resistor to limit the input current to the diode. From the 20mA number you have quoted I would assume your SSR falls into the later category in which case you are lucky you have not yet blown up the input diode. The typical forward voltage of these diodes is around 1.7 volts.

Let's say you need 5A to drive the SSR reliably on (i don't know what yours needs but this is a relatively safe figure). In which cae yo would need a series resistor of (5 - 1.7) / 5mA = 660R. The closest 10% value to this is 680R (ohm). A 100mW resistor would be fine.

Regards, Andrew
Guest








On RB5
PostPosted: Thu May 26, 2005 10:14 am     Reply with quote

There was a "feature" in the PIC18F442's silicon, which some times prevented the PIC from programming (high voltage), if RB5 was not tied to ground. I haven't heard of this problem in 2 years, so it could have been a bug in the silicon, and it was fixed.

Nick
rnielsen



Joined: 23 Sep 2003
Posts: 852
Location: Utah

View user's profile Send private message

PostPosted: Thu May 26, 2005 11:23 am     Reply with quote

I might try hooking up an LED with a 330 ohm resistor and try driving it. Check the voltage output and see if it's okay. If it is, your relay might be trying to pull too much current from the pin. Also, try connecting up the relay in reverse. Instead of driving the pin high to turn it on try driving it low to turn it on. See if that makes any difference.

Ronald
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