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.

TMS570LC4357: TMS570LC4357 - ePWM1 and GIOA0 and GIOA1

Part Number: TMS570LC4357


Hello,

i need your help to resolve an very inexplicable issue.

I'm using GIOA0 and GIOA1 as external interrupt pins for long time.

Along with it i'm using ePWM1A to generate output signal - PERIOD - Turn On, ZERO - Turn off - frequency is 12.5 kHz (80 uS).

I decied to use ePWM1 interrupt also, but when i enable it, processor is overloaded by ePWM1 interrupts.

When I disable GIOA0 and GIOA1 interrupts, the ePWM1 interrupt is generated properly.

Do you know about some corelation which could cause this unexpected behaviour?

Thank you

Jan

  • Hi Jan,

    Yes, the MCU may become overloaded due to an excessive rate of interrupts. The interrupt priority of GIO is higher than the interrupt of PWM. If the GIO interrupt rate is high and their ISR takes long time (for example >40us), the PWM interrupt may not be served at all, other SW part may starve and stop working correctly or collapse.

    The interrupt code should be as short and simple as possible. The ISR (interrupt service routine) should only execute the critical code, the rest of the task can be relegated to the main process by setting a flag variable.
  • Hi Wang,

    yes, i understand that, but i know that ePWM interrupt is running exactly at frequency of 10 kHz, there is just saving of system timer.

    The ePWM starts external peripheral by signal ePWM1A and simultaneously generates interrupt which saves system counter.

    After about 15 uS there comes interrupt from external peripheral on GIOA0 and 1. This should be all and the cycle should be repeated over and over again.

    But it doesn't happen. One of each alone works perfectly, but both are not working together.

    I'm asking if there is some corelation between ePWM interrupt and GIOA0 and 1 interrupt, because i cannot explain this behaviour to my self.

    Jan

  • Hi Jan,

    I noticed that there is no interrupt to PWM, but PWM generates event triggers for external devices or peripherals at zero and period.

    GIOA0/1 interrupt should not affect PWM's output and it's triggers. Can I have your code and do test on my bench? Thanks
  • Hi Wang,

    i will try to make some file with settings of my GIO and ePWM and send it to you.

    At which processor pin could EPWM generate triggers for external devices or peripherals?

    Jan
  • Hi Jan,

    ePWM can generate an interrupt to the CPU and/or a start of conversion pulse to the ADC when a selected event occurs. There is no pin for ePWM interrupt.
  • Hi Wang,

    after few weeks, I'have found the problem and it was caused by unhandled race conditioning.

    Thank you for your time and replies. Consider this threat as solved.

    Jan