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: How to notify starting/stopping of PWM and normal outputs internally

Expert 1995 points
Part Number: TMS570LS3137
Other Parts Discussed in Thread: HALCOGEN

Hello,

I use 6 NHET pins; 3 as normal outputs and 3 as PWM.

I am searching for a way to achieve the following behaviors without the need of physically routing/capturing the outputs as inputs:

1) to generate dedicated interrupts when each PWM starts and stop

2) to generate an interrupt when each output changes its status.

I am reading about the functions generated by halcogen such as pwmNotification for 1) but, if I get it correctly, it generates an interrupt for each PWM period (multiple interrupts) that I should count to distinguish an activation/deactivation period.

Concerning 2): since halcogen shows that both directions are enable any time a pin is set as output, can it also detect rising/falling edge of the pin also as output? Alternatively, can some HR share setting achieve the scope?

Thanks ahead for a reply.

Regards. 

  • Hello,

    It doesn't detect the rising edge or falling edge. It generates the falling edge or rising edge, and generate the interrupt at the same time if the IRQ is enabled in the NHET instruction.

    If ECMP is used to generate PWM, writing 1 to bit 0 of ECMP control field enables the IRQ interrupt. The pin action (pull-H, pull-L, set, or clear) is configured with bit[4:3]. If the Pull-H is selected for pin action, when the value in selected register value (A, B,...)  is equal to the data of ECMP data field, the instruction generates an interrupt and pull the pin to HIGH. 

    If the Pull-L is selected for pin action, when the value in selected register value (A, B,...)  is equal to the data of ECMP data field, the instruction generates an interrupt and pull the pin to LOW. 

    It does not generate interrupt at both edges.