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.

BOOSTXL-BUCKCONV: Expressions window not updating real time

Part Number: BOOSTXL-BUCKCONV
Other Parts Discussed in Thread: SFRA

Tool/software:

Hello,

I am trying to implement TCM feature on my own using BUCKCONV example code. While debugging without runTCM() method inside ISR I  can see the expressions window gettting updated real time.

But as soon as I uncomment runTCM() method and start debugging, the expressions window is not updating at all. I believe it is updated once as I can see the value in the other expressions and it is not continous even though continuous update option is enabled.

Any help please?

  • Hi Mohan,

    Can you provide the source code for the runTCM method you have added, or a link to where you are getting it from?

    Can you verify if the ISR is executing by adding ISR counter or LED blinking? Sounds like there may be some issue with the runTCM function

    Regards,

    Peter

  • Hello Peter,

    The following is my fuction that calls the runTCM to load data into pointer space

    #pragma FUNC_ALWAYS_INLINE(BOOST_runIsr)
    static inline void BOOST_runIsr(void)
    {
        //
        // Record the ePWM TBCTR value for informational purposes.
        // The value is helpful for measuring the sum of ADC ACQPS + ISR latency.
        // The value can also help to confirm that enough time has elapsed for
        //   the Vout ADC conversion to complete and arrive in ADCxRESULT
        //
        BOOST_isrEnter_ticks = EPWM_getTimeBaseCounterValue(BOOST_DRV_EPWM_BASE);

        //
        // Record the most recent ADC conversion of Vout
        //
        BOOST_vOutSensed_pu = BOOST_HAL_readVout_pu();

        #if(BOOST_CTL_LOOP == BOOST_CTL_LOOP_OPEN || BOOST_CTL_LOOP_EXT_DUTY)
        #if(BOOST_CTL_MODE == BOOST_CTL_MODE_VMC)
            //
            // Determine the desired duty cycle setting and update CMPA
            //
            BOOST_dutySet_pu = BOOST_dutySlewed_pu; //(float32_t)0.1;  some BOOST_DUTY_SET_MIN_PU required is 0.05 if we set BOOST_DUTY_SET_MIN_PU to 0 in user settings then epwm is getting tripped
            BOOST_HAL_updateSyncBOOSTDuty(BOOST_dutySet_pu);

            //
            // For informational purposes, calculate and record the amount of
            // time remaining before the CMPA shadow load takes place.
            //
            BOOST_logDutyUpdateMargin(); // This is creating problem now tripping the ewpm and stopping further execution which is reading out samples---MN update resolved by comminting DCL_writeLog
        #endif
        #endif

    //    #if(BOOST_CTL_MODE == BOOST_CTL_MODE_VMC)
    //        BOOST_SFRA_COLLECT(&BOOST_dutySet_pu, &BOOST_vOutSensed_pu);
    //    #endif

        BOOST_vInSamples_Volts[BOOST_adcSampleIndex] = BOOST_HAL_readVin_V();
        BOOST_vOutSamples_Volts[BOOST_adcSampleIndex] = BOOST_HAL_readVout_V();
        BOOST_iLSamples_Amps[BOOST_adcSampleIndex] = BOOST_HAL_readFilteredIl_A();
        BOOST_dutyInSamples_pu[BOOST_adcSampleIndex] =  BOOST_HAL_readDuty_pu();
        BOOST_adcSampleIndex++;
        if (BOOST_adcSampleIndex >= BOOST_AVG_ADC_SAMPLES)
        {
            BOOST_adcSampleIndex = 0;
        }
        //DCL_writeLog(&BOOST_vOutLogFdlog, BOOST_HAL_readVout_V());        This is also creating issue like putting the margin into negative and some thing trips the epwm
        DCL_runTCM(&BOOST_vOutLogTcm, BOOST_HAL_readVin_V());
        BOOST_HAL_clearInterruptFlags();
        BOOST_isrExit_ticks = EPWM_getTimeBaseCounterValue(BOOST_DRV_EPWM_BASE);
    }

  • I added method of blinking LED4 at 1sec based on adc sampling rate 200kHz and when I uncomment the line DLC_runTCM(XXX,XX) method then led is not at all blinking. That means BOOST_runIsr is not running to completion cuz hence the sampling of peripherals is not happening becausee adc interrupt is not getting cleared which is written after this line.

    Why on keeping DLC_runTCM() into BOOST_runIsr halted my ISR execution which in return not clearing interrupt for further sampling on adc?

  • Update: I saw I was missing out EALLOW and EDIS lines in my main.c file before and after EINT and ERTM lines. Now I can see the ISR executing and no longer getting blocked by DLC_runTCM() method.

    Can I know what really happened? I feel like as I didnt allowed the access to protected registers like INT and RTM I couldnt enabled them and so something went wrong and my DLC_runTCM() was doing something unexpected. Could you please correct me if I am wrong Peter?

  • Hi Mohan,

    Yes as you have seen EINT is a required part of the main configuration loop and it is necessary to define it. The global Interrupt Mask (INTM) is enabled on reset, so this call will clear the INTM and enable the CPU interrupts. ERTM is also required since it allows the CPU to be able to receive interrupts even when the CPU is halted for debugging.

    You are correct, these are protected registers and you must call EALLOW prior to defining EINT/ERTM/IER or else these calls will have no effect and interrupts will not be enabled. Calling EDIS afterwards locks these protected registers afterwards

    Regards,

    Peter