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.

TMS320F28P550SG: Using XINT1 event to trigger DMA

Part Number: TMS320F28P550SG


Tool/software:

Hi experts,

I ask this for my customer.

My customer want to measure the High level time of the signal that input to DSP, now the ecap and epwm module is not enough. What's more, they don't want generate the Additional interruption to realize this function. They just want to check this value in their current PWM interrupt(30KHz)

So I suggest them to use this solution:

1. Using XINT1 that generate the XINT1 event in falling and rising edge.

2. Enable the Timer2.

3. Using XINT1 as the trigger source to trigger DMA to transfer the CPUTIMER TIM register to a buffer. DMA will set the burst is 2 to realize: when the first XINT generate(trigger in rising edge), the DMA place the TIM value to buffer[0], and when the second XINT generate(trigger in falling edge), the DMA place the TIM value to buffer[1]. And in the PWM interrupt, they use buffer[1] - buffer[0] to get the High level time of the input signal.

But now I have some problem,

1. Is this solution reasonable? Is it possible not generate the ISR but generate the XINT event to trigger DMA?

2. I think it can. But I can't trigger DMA, could you help to check if it any error in my configuration?

3252.gpio_ex2_toggle.zip

3. Since Timer will achieve its max value and will re-start from zero, so I can't guarantee the buffer[1] always greater than buffer[0]. So is it possible to let DMA place zero to TIM(reset Timer) in first XINT1(in the rising edge) and let DMA place TIM to buffer in second XINT1(in the falling edge)?

BRs

Shuqing

  • Hi Shuqing,

    Can you clarify more why the eCAP module doesn't meet their requirement? Because the most straight forward solution for this would be to have the eCAP read in the width of the signal and trigger the DMA (using the ECAP trigger source) to move that data from the eCAP register into memory.  

    Best Regards,

    Delaney

  • Hi Delaney,

    Because they use all the module of ECAP for other function. Not the performance of ECAP isn't enough, the number of ECAP module is enough. So we need other solution as workaround.

    BRs

    Shuqing

  • Hi Shuqing,

    I understand now, thank you for clarifying. 

    1. Is this solution reasonable? Is it possible not generate the ISR but generate the XINT event to trigger DMA?

    Yes, I think this solution sounds reasonable. Yes, you should be able to use XINT as just a DMA trigger source and not an interrupt.

    2. I think it can. But I can't trigger DMA, could you help to check if it any error in my configuration?

    I will look into your code and get back to you.

    3. Since Timer will achieve its max value and will re-start from zero, so I can't guarantee the buffer[1] always greater than buffer[0]. So is it possible to let DMA place zero to TIM(reset Timer) in first XINT1(in the rising edge) and let DMA place TIM to buffer in second XINT1(in the falling edge)?

    I would suggest making the period a large value (one that you know will never be reached) and calling CPUTimer_reloadTimerCounter() at the end of your ePWM ISR. Do you know the upper limit of how long the input signal could be high?

    Best Regards,

    Delaney

  • Hi Delaney,

    I think I find the reason that why I don't transfer the data in my code.

    In my code, I don't place the variable in GSRAM but place in LSRAM. And in F28P55, DMA can't access the LSRAM, it just can access the GSRAM.

    As long as I place the variable in GSRAM, it can transfer the data successfully.

    But now the problem is that I check the DAM access to CPUTIMER, it seems DMA can't access the CPUTIMER

    How could I do next?

    BRs

    Shuqing

  • Hi Shuqing,

    Yes, that is a good point. DMA can only access GSRAMs. For the CPU Timer peripheral, you are correct, DMA actually does not have access to this. You could alternatively use the PWM module as a counter instead of the CPU timer, which DMA does have access to. Will this be feasible for the customer?

    Best Regards,

    Delaney

  • Hi Delaney,

    They can accept use EPWM instead of CPU timer, and I have provide the workable demo to them to transfer the data from EPWM TBCTR to buffer. But have another question from customer. They need to use XINT1~XINT5 to measure 5 input signal.

    If GPIO need to generate the XINT, it needs GPIO connect to inputXBAR, and inputXBAR also connect to other module. For example, GPIO connect to inputxbar6 and connect to XINT3. But this also connect to TRIP6, is it influence the PWM module? Can they disconnect the inputxbar6 with TRIP6?

    And this INPUTXBAR also connect to ECAP. If they use ECAP also, is it influence the ECAP module?

    BRs

    Shuqing

  • Hi Shuqing,

    Let me loop in the XBAR expert to answer this question. 

    Best Regards,

    Delaney

  • Hey Shuqing,

    INPUTXBAR.XINT3 wouldn't be tied to EPWM.TRIP6 unless the EPWM is configured to use it as the TRIP source. While all those signals use INPUTXBAR6, this doesn't mean that they will all constantly recieve and act on that trigger signal if it only configured to work with a specific destination option. There is no concept of disconnecting a signal from the INPUTXBAR, just connected or disconnected.

    Best Regards,

    Zackary Fleenor

  • Hi Zackary,

    Thanks for your reply!

    Where I can choose the INPUTXBAR destination?

    INPUTXBAR.XINT3 wouldn't be tied to EPWM.TRIP6 unless the EPWM is configured to use it as the TRIP source.

    Or I can't choose the INPUTXBAR destination? For example, TRIP6 will always connect to INPUTXBAR6 as long as I configurate the TRIP6 as the EPWM TZ source?

    But if I don't choose the TRIP6 as the EPWM TZ source, INPUTXBAR6 will not connect to EPWM?

    BRs

    Shuqing

  • Hey Shuqing,

    Rather then configuring an INPUTXBAR destination directly, it's rather that you program the destination IP to use the associated INPUTXBAR source option or not. If the configuration isn't made, then the connection won't populate even if that inputxbar signal is actively used by another destination.

    Best Regards,

    Zackary Fleenor