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

can invert the PWM signal?

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



Joined: 14 Feb 2020
Posts: 23

View user's profile Send private message

can invert the PWM signal?
PostPosted: Thu Jul 02, 2020 5:45 pm     Reply with quote

Can invert the PWM signal?
Instead of starting positive, start negative for one of the PWM
Code:

setup_compare (1, COMPARE_PWM | COMPARE_TIMER2);

setup_compare (2, COMPARE_PWM | COMPARE_TIMER3);

to generate the PWM.

PIC: dsPIC33FJ16GS504
temtronic



Joined: 01 Jul 2010
Posts: 9241
Location: Greensville,Ontario

View user's profile Send private message

PostPosted: Thu Jul 02, 2020 7:01 pm     Reply with quote

Depends on the PIC and the PWM peripheral but of course the easy 'cheat', that any PIC can use ... is to just swap the 'off' and 'on' values....
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