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

Over ride the PWM and set the output bit high?

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



Joined: 11 Nov 2008
Posts: 29

View user's profile Send private message

Over ride the PWM and set the output bit high?
PostPosted: Sat May 16, 2009 8:12 am     Reply with quote

Hi All,

I am using a 18f2520 with compiler version 4.073 and need to set the PWM output pin high at the end of the PWM code. When I set the PWM duty to 0, pin C2 is in a low state. I need to set it high to have the braking function work in a LMD18200. I tried output_bit(PIN_C2, 1); however it does not set C2 high. Is there someway to over ride the PWM and set the output bit high?

Ray
Ttelmah
Guest







PostPosted: Sat May 16, 2009 9:43 am     Reply with quote

Just set the duty to the maximum.....

Best Wishes
frierray



Joined: 11 Nov 2008
Posts: 29

View user's profile Send private message

PostPosted: Sat May 16, 2009 3:39 pm     Reply with quote

Thanks, that did just what I needed. So the output_bit(PIN_C2, 1); cannot override the PWM state for the pin.
FvM



Joined: 27 Aug 2008
Posts: 2337
Location: Germany

View user's profile Send private message

PostPosted: Sun May 17, 2009 2:42 am     Reply with quote

As the hardware manual clarifies, second output functions of I/O ports take priority over the port function. You have to disable the respective function, e.g. PWM, UART output, SPI to reenable port operation.
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