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.

TMS570LS3137: External PWM-sync IO

Part Number: TMS570LS3137

Is there a way to synchronization the PWM(N2HET) cycle to an external IO-pin? I saw the register bit in HETGCR.CMS, which sets the N2HET as a master or slave, but I don't see in the TRM or datasheet which IO pin can be used for this sync.

Also what is the specific behavior of this sync-input -- does the N2HET-cycle restart on EVERY edge (so an external glitch-edge would restart the current cycle, even if it was in the middle?

Thanks,

Jim

  • Hello Jim,

    In some applications the N2HET resolutions must be synchronized. Some other applications require a single time base to be used for all PWM outputs and input timing captures.

    The N2HET provides such a synchronization mechanism. The clock master/slave (HETGCR.CMS[16]) configures the N2HET in master or slave mode (default is slave mode). A N2HET in master mode provides a signal to synchronize the prescalers of the slave N2HET. The slave N2HET synchronizes its loop resolution to the loop resolution signal sent by the master. The slave does not require this signal after it receives the first synchronization signal. However, anytime the slave receives the re-synchronization signal from the master, the slave must synchronize itself again..

    The HETGCR.CMS[16]) bit is not used to synchronize N2HET with other peripherals.

    N2HET signals can be used to trigger ADC sampling, and N2HET signals can also be used as MiBSPI event trigger.
  • Hello Jim,

    The the N2HET pins can be synchronized to the loop resolution. If the number of time slots used in a program loop exceeds the number available in one resolution, the program overflow occurs. The pin action will not be taken if the instruction that caused the pin action falls on a program overflow, so the synchronization for this pin will be lost.

    If you want to use one NHET input signal to sync several other NHET signals (for example output PWM waveforms). You can do it in NHET code to trigger BR instruction to execute the instructions to output those PWMs, they are synchronized in the loop resolution.

    For synchronization between N2HET1 and N2HET2, no external signal is required except for setting the HETGCR.CMS[16] bit. There is internal HW sync mechanism between N2HET1 and N2HET2.
    1. Select master by setting HETGCR.CMS
    2. Configure NHET master
    3. Configure NHET slave: The loop resolution of the master must be the same as the slave’s loop resolution.
    4. Turns on the slave, and it will wait for the sync from the master NHET to start the program execution
    5. Turn on the master
  • QJ,

    Thank you for the quick reply. I might not have been clear -- The problem I am trying to solve is I need to synchronize multiple TMS570LS3137-PWMs via an external IO-pin (if possible). Is there a mechanism to provide an external PWM-sync-input?

    Thanks,

    Jim

  • Jim,

    Yes, you can one NHET input to sync other PWMs or to trigger other PWMs' output.
  • QJ,

    What CPU-IO-pin is used to sync the PWM? I searched the datasheet for "sync" and "PWM", and did not find any external-IO pin that could do this.

    Thanks,

    Jim

  • Jim,

    There is no way to provide an external signal to define the time base used by the N2HET.

    Regards,
    Sunil