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.

C6748 conflict between SPI by EDMA and interrupt of EHRPWM

Other Parts Discussed in Thread: OMAPL138

I have an application on C6748 which use principally 3 peripherals :

- McASP to acquire samples from an 8 channels ADC working at 3200Hz. The samples are acquired by EDMA in blocks working in flip flop

- SPI in slave mode to configure application and send results. The results are sent every second on SPI by using EDMA

- EHRPWM at  5000Hz to generate sinus. The width (CMPA register) of the PWM is updated by interrupt every 200us.

The McASP works properly, the SPI works properly. The PWM 'alone' works properly. But, in the application, every second, when data are sent by DMA on SPI, there are  false PWM interrupts : instead of having interrupts every 200us, we have many wrong interrupts. On following display channel 2 rises at start of transfer DMA on SPI and goes back to 0 at end of DMA channel tansfer. On channel 1, the signal goes high at start of PWM interruption and goes low at end of PWM interrupt.

I have mad Emany traials :

- modification of HWI interrupt priority between EDMA and PWM

-Interruption programms and datas used by these programs in internal memory

- In interrupt of PWM test if interrupt is really theree before updating register CMPA with the new value of PWM

WHATEVER I TRY, DOES NOT CHANGE ANYTHING. I HAVE ALWAYS FASE PWM INTERRUPTS.It seems that functionning of EHRPWM is disturbed when there is a transfer by DMA on SPI. It is complely incredible.

Anaybody who has an idea is welcome

Anne-Marie

  • Hi,

    Thanks for your post.

    I am not sure whether you are aware that you do not have provision to trigger EDMA events to generate interrupts and both ehrpwm0 & ehrpwm1 output channels do have feasibility only to generate CPU interrupts which are PWM timing interrupts and tripzone interrupts.

    we don't have a EDMA channel for eHRPWM peripheral and may be, this could be cause of conflict between SPI-EDMA transfer and EHRPWM interrupt.

    For more details, please refer EHRPWM module from omapl138 TRM as below:

    http://www.ti.com/lit/ug/spruh77a/spruh77a.pdf

    Thanks & regards,

    Sivaraj K

    -------------------------------------------------------------------------------------------------------

    Please click the Verify Answer button on this post if it answers your question.

    -------------------------------------------------------------------------------------------------------

  • Hi,

    First, thank you for your answer.

    I am really aware that I can not link EHRPWM to a DMA.

    But, I am surprised that there can be a conflict between CPU interrupts and EDMA interrupts.

    Because I use :

    1/ interrupts from DMA : to manage transfer of samples from ADC on McASP, and to receive and send date to host processor by SPI

    2/ CPU interrupts from EHRPWM to generate signal for test

    3/ CPU interrupts to manage modification of input states .

    And there are no conflicts between CPU interrupts issued from TTL input and EDMA, and no conflict between interrupt from McAsp (managed by DMA) and CPU interrupts (EhrPwm and TTL input).

    The only conflict is between Tx on SPI by DMA and CPU interrupt from EhrPWM..... It is very surprising. It seems that a transfer by DMA to SPI induces an interrupt on PWM

  • Hi,

    It is totally not agreed on your point that, EDMA transfer to SPI inducing an EHRPWM interrupt to CPU. I think, there is no way related between DMA transfer which is inducing CPU interrupt from EHRPWM.  Is there any code interpretation that DMA transfer to SPI induces an EHRPWM interrupt to CPU? I mean, do you have any interrupt configuration for EHRPWM set in the code after completion of DMA transfer to SPI tx. data?

    Thanks & regards,

    Sivaraj K

    -------------------------------------------------------------------------------------------------------

    Please click the Verify Answer button on this post if it answers your question.

    -------------------------------------------------------------------------------------------------------