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

output_high voltage level output

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



Joined: 29 Jan 2007
Posts: 2

View user's profile Send private message

output_high voltage level output
PostPosted: Mon Jan 29, 2007 12:14 pm     Reply with quote

I'm using a PIC18F4550 with a 5V supply, and am using RB0 for a digital output. My program sets this pin high in 20 ms intervals anywhere from 1.25 ms to 1.75 ms (driving a motor), but my oscope shows my output is only going up to 1V, not 5V. From the curve it's clear it has reached its final value easily and it's not the case it doesn't have enough time to switch.

I searched the documentation and the device header for any clues, but there is no indication whether or not output_low and output_high refer to the rail values as I assumed. Does anyone know for sure?
newguy



Joined: 24 Jun 2004
Posts: 1904

View user's profile Send private message

PostPosted: Mon Jan 29, 2007 12:24 pm     Reply with quote

The output_high() and output_low() functions do as you expect: set a pin to Vdd or Vss. If you're observing a pin that isn't making it to Vdd, I'd suspect whatever the pin is trying to drive, not the PIC itself. Break the connection between the PIC and the circuit it is driving and you'll see that it does (or should) go to 5V. If not, the PIC is likely damaged.

One other thing: are you sure your scope is set properly? Seeing 1V and expecting 5V sounds suspiciously like a scope vertical scale issue (5V/div vs. 1V/div).
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Mon Jan 29, 2007 12:27 pm     Reply with quote

What's the impedance of the load on the pin ? The data sheets says
the maximum current that a PIC pin can supply is 25 ma. What is
the load ? Is the pin directly driving the motor ? Preferably, you
should have a separate driver such as a FET or a transistor which
will drive the motor.
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