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.

MSPM0G3507: Run motor_control_bldc_sensorless_foc\sensorless-foc_DRV8329 Example without DRV8329

Part Number: MSPM0G3507
Other Parts Discussed in Thread: DRV8329

Tool/software:

Hi,

I used the HAL of motor_control_bldc_sensorless_foc\sensorless-foc_DRV8329 Example to get my SW running on MSPM0G3507 together with DRV8329.

The next step would be to control an other gate driver. (MSPM0G3507 Launchpad without DRV8329).

But it looks like without DRV8329 attached the interrupt GENERIC_PWM_0_INST_IRQHandler is not working.

Do you have any hints whats need to be changed?

Best Regards,

Matthias

  • Hi Mattias,

    First of all, I suggest you can start with DRV8329 EVM board, and check whether it can work, Then you can migrate it to your own gate driver.

    I also check the example project of the example, it does NOT have the GENERIC_PWM_0_INST_IRQHandle you mentioned. So, what is the SDK version you used? I suppose you should use the latest SDK version which is 2.01,

    B.R.

    Sal

  • Hi Sal,

    I already have my SW running on DRV8323RS. In my last post I accidentally revert to another DRV but it is 

    DRV8323RS which I have. I use the latest SDK (mspm0_sdk_2_01_00_03).

    Any idea why interrupt GENERIC_PWM_0_INST_IRQ Handler is not working?

    Best Regards,

    Matthias

  • Sorry I notice that example I refer to comes from mspm0_sdk_1_20_01_06

    C:\ti\mspm0_sdk_1_20_01_06\examples\nortos\LP_MSPM0G3507\motor_control_bldc_sensorless

  • Hi Mattias,

    mspm0_sdk_1_20_01_06 do not support DRV8329, and we do not keep maintain this version. So, it requires user's effort to migrate the demo code and run with the EVM board.

    Sal

  • I have some personal advice for this. Interrupt is trigger by PWM itself, so it might related below several scenarios:

    1. you haven't start the timer, so it will not trigger the interrupt

    2. you set a unproperly CC value of the channel, which you set to trigger interrupt

    3. you have set a higher priority interrupt thar occupy the CPU running cycle, so the pwm interrupt can not entry.

    4. some other task in the project disable the interrupt mask of the pwm. you should enter the debug mode and check the pwm interrupt setting.

    B.R.

    Sal

  • Hi Sal,

    the SW is working with DRV8323RS attached (motor is running) and I get the interrupts. But when I disconnect DRV8323RS I did not get the interrupt anymore. I also set the Jumper J18 again which should be removed when DRV is attached.

    So, I made no changes on the SW.

     Do you have any idea why? 

    It seems GENERIC_PWM_0_INST_IRQHandler relays in some way on DRV connection?

  • ti foc is uncomented Adc_Isr contains my foc code.
    void GENERIC_ADC_1_INST_IRQHandler(void)
    {
        //DL_GPIO_setPins(GPIO_LEDS_PORT, GPIO_LEDS_USER_LED1_PIN);
        ADCStatus |= ADC1_DATA_READY;

        /* HAL layer collects the ADC data if HAL channel is defined in the
         HAL layer. The api also returns the pending IRQ, the user can use this
         for any custom application */
        DL_ADC12_IIDX pendIrq = HAL_processADCIRQ(GENERIC_ADC_1_INST);
        //DL_GPIO_clearPins(GPIO_LEDS_PORT, GPIO_LEDS_USER_LED1_PIN);
    }

    void GENERIC_ADC_0_INST_IRQHandler(void)
    {
        //DL_GPIO_setPins(GPIO_LEDS_PORT, GPIO_LEDS_USER_LED1_PIN);
        ADCStatus |= ADC0_DATA_READY;
        /* HAL layer collects the ADC data if HAL channel is defined in the
        HAL layer. The api also returns the pending IRQ, the user can use this
        for any custom application */
        DL_ADC12_IIDX pendIrq = HAL_processADCIRQ(GENERIC_ADC_0_INST);
        //DL_GPIO_clearPins(GPIO_LEDS_PORT, GPIO_LEDS_USER_LED1_PIN);
    }


    void GENERIC_PWM_0_INST_IRQHandler(void)
    {
        DL_GPIO_setPins(GPIO_LEDS_PORT, GPIO_LEDS_USER_LED1_PIN);
        //uint16_t vmAdc, iaAdc, ibAdc, icAdc;
        if(ADCStatus == ADC_READY)
        {
            //vmAdc = DRV8323RS_getVMRaw(&drv8323rs);
            //iaAdc = DRV8323RS_getIARaw(&drv8323rs);
            //ibAdc = DRV8323RS_getIBRaw(&drv8323rs);
            //icAdc = DRV8323RS_getICRaw(&drv8323rs);
            //FOC_loop(&foc, vmAdc, iaAdc, ibAdc, icAdc);
            Adc_Isr();
            ADCStatus = ADC_STATUS_RESET;
        }
        DL_GPIO_clearPins(GPIO_LEDS_PORT, GPIO_LEDS_USER_LED1_PIN);
    }

    void GENERIC_TIM_0_INST_IRQHandler(void)
    {
        //FOC_CONTROL_run(&foc);
    }

    void GENERIC_CAPTURE_0_INST_IRQHandler(void)
    {
        //IPD_ISR(&ipd, &foc.hal);
    }
  • Hi Mattias,

    There is a nFAULT pin for the project, maybe you should connect it to VCC, then the project could output.

    B.R.

    Sal