Logic inversion?


#1

Sinple question… in xod, How do I invert of a pwm signal so on (high) is off (low) and off is on? I ask because I an driving a mosfet through a bjt and the logic is inverted.


#2

The easiest solution is probably to feed (1-val) instead of (val) to the pwm node. 25% on will become 25% off, etc.


#3

so just to be sure, do you mean I should (for example) write -1 instead of 1? just to make sure.

otherwise, could you somehow give me an example?

thank you so much for any help though!


#4

Input range for pwm node is 0 to 1. To invert subtract the original value from 1. If the original value is 1, then you want 0 (1-1 = 0). If the original value is .5, you still want .5 (1 - .5 = .5). If the original value is 0, you want 1 (1 - 0 = 1).