Jump to content
43oh

LAUNCHXL-F28069M


Recommended Posts

I am using Energia 17 environment with LAUNCHXL-F28069M board. I would like to implement PWM signal on two pins. One signal for example with 30% duty cycle and second inverted to the first one. It means when 1st pin is HIGH the 2nd should be LOW and conversely. In arduino language is only one function for PWM "analogWrite(80,100)". How to set inverted PWM signal in the same phase on second pin?

Link to post
Share on other sites
  • 5 months later...
On 9/11/2017 at 12:56 PM, karpiozo said:

I am using Energia 17 environment with LAUNCHXL-F28069M board. I would like to implement PWM signal on two pins. One signal for example with 30% duty cycle and second inverted to the first one. It means when 1st pin is HIGH the 2nd should be LOW and conversely. In arduino language is only one function for PWM "analogWrite(80,100)". How to set inverted PWM signal in the same phase on second pin?

  I think the command below would work:

  pin_2_state = !digitalRead(pin_1); 

  digitalWrite(pin_2, pin_2_state);

  Keep in mind that this doesn't add dead-time between pin  1 and pin 2 though.

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...