PWM signal Switching between line to line_n at run time

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
lock attach
Attachments are accessible only for community members.
DeAa_335316
Level 4
Level 4
First like received

i am using CYBLE-022001-00 / BLE module and generating 1Hz to 40 Hz PWM signal . some time i need inverted signal of waveform signal (example 1Hz signal ). for that i need two different pin for taking inverting and non-inverting signal out .

   

Instead of two GPIO pin  i want to use only single GPIO pin for generating both signal and that switching event must be control through my main() program .

   

KEYWORD-

   

void TCPWM_SetPWMInvert(uint32 mask)

   

Example -

   

T0 second  - PWM output through PIN 1 is Non_Inverting

   

T0+1 second - PWM output through PIN 1 is Inverting 

   

 

   

*Please check the attached jpg also.

0 Likes
5 Replies
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

Have a look into the TCPWM Datasheet for TCPWM_SetPWMInvert() which controls the polarity. Should be availlable for your PRoC module.

   

 

   

Bob

0 Likes
HeLi_263931
Level 8
Level 8
100 solutions authored 50 solutions authored 25 solutions authored

You can route the PWM output through an XOR gate. Depending on the second input of this gate the PWM signal will be inverted or not.

0 Likes
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

@hli

   

Are there XORs in a PRoC module (UDBs)

   

 

   

Bob

0 Likes
HeLi_263931
Level 8
Level 8
100 solutions authored 50 solutions authored 25 solutions authored

Oh, I forgot to check. Since the PRoC has no UDBs, there are no gates. In that case, I would re-configure the PWM (change the compare type from 'less than' to 'greater than', and the compare value to 'period-compare value').

0 Likes
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

... or use TCPWM_SetPWMInvert()

   

 

   

Bob

0 Likes