4 Replies Latest reply on May 30, 2018 12:41 PM by jebr_3270776

    Approach advice on multiple period PWM outputs



      I had an application designed to control 16 outputs using a variable PWM period that I set via the UART.  The approach was fairly simple.  Create a PWM signal that cycles through the multiplexer using a counter of variable size (controlled by the PWM). Below is a screenshot of my current approach (you can ignore the LEDS and TP points, those were added trying to solve my new challenge):



      Anyway, scope creep has popped up after I've designed the hardware (of course) and I need to find a new approach to try and work with the current hardware.


      Rather than having a set time on each channel, I now have been asked to have variable times on each channel.  Normally, I'd look at having multiple PWM signals in parallel but, due to the high current requirements and the trace widths on the hardware, I can't enable the channels at the same time (it's for a valve application at 250mA each).  So somehow, I need to set the timing for one channel, run it for a desired time, then switch the time and activate the next one.


      My idea to do it with this same block diagram is to activate an interrupt on the falling edge of the PWM signal, change the PWM timing, switch to the next channel (which is already handled with the above circuitry), and enable it again.  I assume the interrupt would set the Kill/Reset bit of the PWM to 1, change the timing, and then re-enable it again.  Then when it drops low again, I repeat the process.  The problem with this is that I can't seem to figure out how to trigger an interrupt on an active low condition on the PWM block.


      Realistically, I might just need to change my entire approach for this but I thought I'd post in here and see if anyone had any recommendations on the best way to approach this.  Any information would be greatly appreciated.  Thanks!