This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

RM4 N2HET Generate Negative PWM on Pin[N+1]

Hi,

We have a situation where we are driving N2HET[0] with a complex PWM program (20+ instructions).

Is it possible to also drive N2HET[0+1] with the inverse of that program, without necessarily adding a another PWM program with the pins setup differently.

I've looked at AND and XOR structures but these seem to relate to output. Is there simply a NOT function in software (or similar) without having to add a NOT gate on the hardware side?

Thanks

Stomp!.

  • One of our timer experts will help you with this. Thanks.
  • Hi Stomp,

    There isn't any simple 'inverse' function that I can think of,  and the AND & XOR SHARE are meant to map 2 logical pins onto one physical pin. 

    Not the opposite way - where you have the logic for one pin but map true and complement to two pins.

    The best that I think you can do is to try to replicate part of the program - not the whole PWM program - for the 2nd inverse pin.

    How many instructions this takes will depend on your overall program structure.   But let's assume you are using an ECMP to set one pin.

    Then a 2nd ECMP with the 'opposite' pin setting on a 2nd pin, but otherwise written to with the same buffered data and updating a 2nd pin would be the starting point. 

    If you need to introduce a deadband between turn on and off - then it would be more complicated.   We have an example of a 3 phase PWM w. 6 outputs (true and complement) and deadband posted on this forum so you could look at that program if it is what you are after.

    Alternatively - the EPWM module does have this sort of capability built in.   So if you are using an RM46, RM57 or RM44 type part with the ePWM modules you might want to investigate using these.


    EDIT:  I should also say that if you want me to look at your particular code and make some suggestions that's fine too.   But I sense you're getting really good at HET so didn't think of it right away.  If you can't post it to the forum - then you can email it to me directly if you like. 

  • Hi Anthony,
    Thanks again for your help!.

    We are using RM48, so no ePWM. We decided to put an inverter on the PCB, rather than expand our N2HET program.

    Maybe on the RM4 wiki we could have a wish-list of future silicon improvements?. I'd start with:

    1. Boolean (AND/OR/NOT) on N2HET output Pins
    2. CRC module handle general polynomials for implementing things like CRC16, etc.

    Thanks
    Stomp!.