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.

TMS320F28069M-Q1: Issue with IDLE in MWARE code

Part Number: TMS320F28069M-Q1
Other Parts Discussed in Thread: C2000WARE

I took the code from MWARE on a custom board with F28069M and commented out the motor code, so I can use ADC12 at 15KHz via interrupt which triggers ADC12 capture as per motor demo code.

I was exploring the IDLE, HALT, STANDBY. The HALT and STANDBY code working good. I could not get IDLE to work correctly, I tried disabled interrupt but no success.....have I missed something?

// Demo code include wakeup: C:\ti\c2000\C2000Ware_3_03_00_00\device_support\f2806x\examples\c28\lpm_idlewake
// We only run to measure current.

DINT;
WDOG_disable(uhal->wdogHandle);
WDOG_disableInt(uhal->wdogHandle);
CPU_disableDebugInt(uhal->cpuHandle);
CPU_disableGlobalInts(uhal->cpuHandle);
//uhal->pieHandle->PIEIER_PIEIFR[0].IER &= ~10; // Disable ADC_IntNumber_1HP
ADC_disableInt(uhal->adcHandle,ADC_IntNumber_1);
CPU_disableInt(uhal->cpuHandle,CPU_IntNumber_1);
// PIE_enableAdcInt(obj->pieHandle,ADC_IntNumber_1HP); // enable the PIE interrupts associated with the ADC interrupts
// ADC_enableInt(obj->adcHandle,ADC_IntNumber_1); // enable the ADC interrupts
// CPU_enableInt(obj->cpuHandle,CPU_IntNumber_1); // enable the cpu interrupt for ADC interrupts
EALLOW;
if (SysCtrlRegs.PLLSTS.bit.MCLKSTS != 1) // Only enter Idle mode when PLL is not in limp mode.
{
SysCtrlRegs.LPMCR0.bit.LPM = 0x0000; // LPM mode = Idle
}
EDIS;
__asm(" IDLE"); // Device waits in IDLE
for(;;) {}

  • You might have a look at the example in C2000Ware, try to run the enterLPM() function in RAM, and power down the flash bank to enter the IDLE mode.

    C:\ti\c2000\C2000Ware_3_04_00_00\driverlib\f28004x\examples\lpm

  • //==================================================================
    //================================================================== RVP_ResetMCU
    // Purpose : For MCU Reset
    // Input : 0 = 90MHz (PPL), 1 = 60Mhz (PPL) and 2 = 20MHz (PPL Off), 3 = IDLE, 4 = STANDBY, 5 = HALT.
    // Output :
    // Note : Assumed 20MHz external XOSC fitted.
    //==================================================================
    #pragma CODE_SECTION(RVP_Modify_MCUClock,"ramfuncs");
    void RVP_Modify_MCUClock(uint16_t SelectFreq)
    {
    HAL_Obj *uhal = (HAL_Obj *) halHandle;
    USER_Params *pUserParams = &gUserParams;
    DINT;
    switch (SelectFreq)
    {

    .....

    case(3): //IDLE Mode
    {
    // Demo code include wakeup: C:\ti\c2000\C2000Ware_3_03_00_00\device_support\f2806x\examples\c28\lpm_idlewake
    // We only run to measure current.

    DINT;
    WDOG_disable(uhal->wdogHandle);
    WDOG_disableInt(uhal->wdogHandle);
    CPU_disableDebugInt(uhal->cpuHandle);
    CPU_disableGlobalInts(uhal->cpuHandle);
    //uhal->pieHandle->PIEIER_PIEIFR[0].IER &= ~10; // Disable ADC_IntNumber_1HP
    ADC_disableInt(uhal->adcHandle,ADC_IntNumber_1);
    CPU_disableInt(uhal->cpuHandle,CPU_IntNumber_1);
    HAL_disabalePwmInt(uhal);
    EALLOW;
    if (SysCtrlRegs.PLLSTS.bit.MCLKSTS != 1) // Only enter Idle mode when PLL is not in limp mode.
    {
    SysCtrlRegs.LPMCR0.bit.LPM = 0x0000; // LPM mode = Idle
    }
    EDIS;
    FLASH_setPowerMode(uhal->flashHandle,FLASH_PowerMode_PumpAndBankSleep);
    __asm(" IDLE"); // Device waits in IDLE
    for(;;) {}
    #pragma diag_suppress=112
    break;
    #pragma diag_default=112
    }

    The above code modified as suggested, the code is in RAM and FLASH put to sleep..... but failed to IDLE there.

    Suggestion?

    R. 

    NB: I cannot use the insert code feature since it crashes. 

  • I have also clear all PIE flag and ACK (all 0x0000) before IDLE and include disconnection of the XDS200 device. It does not stay IDLE. 

  • I presume your problem is not in entering IDLE, but staying in IDLE. Clearly, some interrupt (or activity on a GPIO pin) is waking up the device. Please look for any kind of interrupt or pin activity; that should be the root cause.