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.

TMS320F28377D: Method to sample Real world data at twice the frequency of Control loop execution.

Part Number: TMS320F28377D


Hi,

I am using DSP C2000 F28377D for a project. My main control loop is being executed in the ADC ISR having a frequency of 15KHz. But there is a mismatch in actual current reading and sensed current as there are ripples in my current. So in order to average out ripples and get the correct value I need to sample at twice the control loop frequency i.e. 30KHz.  As the application is time critical is there any way such that the main control loop ISR is not interrupted in between and I can still sample at 30KHz.

Thanks

Nishant 

  • Nishant,

    Yes, the C2000 is designed to do that.  You'll need to take a look at how you have configured your ADC and whatever is triggering it.  Typically the ADC SOC is triggered from a PWM timer and your interrupt happens when the conversion is complete?

    If this is how your project is configured it will be a matter of adding another ADC trigger to the PWM configuration, probably using a CMPC or CMPD event, then configuring the ADC to sample the same channel on that event but not generate an interrupt.  This way, when you do get the existing 15 kHz interrupt there'll be two samples waiting to be read.  The detail depends on how you have the PWM and ADC configured now.

    I recommend you review the online training workshop for this device to be sure you understand how to configure the PWM and ADC, then look at your configuration and make the changes.  In principle it's straightforward.  The workshop link is:

    Regards,

    Richard