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.

CCS/TMS320F280041C: InstaSPIN adc triggering

Part Number: TMS320F280041C

Tool/software: Code Composer Studio

Greetings! I have a problem with the moment I`m reading the ADC sygnals. I`m running my PWM at 4kHz and my half period cycles are 6250(12500 full). I have a pin which I turn off when the main interrupt occurs and I drive it high when the values are read. I am doing this because example 4 sygnal chain test doesn`t turn the motor(I have only sound from the motor but no movement). So I`m using CMPC of PWM1 as a trigger of the main interrupt. In the beginning I`ve set this value to 6000. This seems to trigger the interrupt just in middle of the pulse(if duty cycle 50% the moment of switching between channel A and B). I think this causes my problem, because these is a deadtime and there is no transistor open in this moment. So I am trying now to set this trigger moment in the middle of the channel A pulse. In a simple test this happens when I set the CMPC to 10000. The problem is when I add the program logic to the ISR this somehow blocks the interrupt from triggering. I think 10000 a very high value, because I have only 6250 into the counting register. When should my interrupt be triggered? In the middle of the pulse? In the pulse A duration? 

Is this approch correct or I need to change something else?

THanks!

  • What current sensor are you using? You might refer to the configuration codes in the example project if you are using the three shunt resistor on the low side as TI EVM kits, or hall sensor, or inline shunt resistor.

    If you haven't had a chance to look at the workshop material, I think this will help demystify some of the terminology and architecture as well. You could set the related SOC to trigger the ADC as you want.

    https://training.ti.com/c2000-mcu-device-workshops

  • I did it! Thanks! I had changed the settings of the PWM channels. 

            EPWM_setActionQualifierAction(obj->pwmHandle[cnt],
                                          EPWM_AQ_OUTPUT_A,
                                          EPWM_AQ_OUTPUT_LOW,
                                          EPWM_AQ_OUTPUT_ON_TIMEBASE_UP_CMPA);
    
            EPWM_setActionQualifierAction(obj->pwmHandle[cnt],
                                          EPWM_AQ_OUTPUT_A,
                                          EPWM_AQ_OUTPUT_HIGH,
                                          EPWM_AQ_OUTPUT_ON_TIMEBASE_DOWN_CMPA);

    So when I did it that way, everything is fine. The example 4 is working!
    THanks!