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:在 Mware 代码中出现空闲问题

Guru**** 2537260 points
Other Parts Discussed in Thread: C2000WARE

请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

https://e2e.ti.com/support/microcontrollers/c2000-microcontrollers-group/c2000/f/c2000-microcontrollers-forum/992461/tms320f28069m-q1-issue-with-idle-in-mware-code

器件型号:TMS320F28069M-Q1
主题中讨论的其他器件:C2000WARE

我从具有 F28069M 的定制板上的 MWare 中获取了代码、并注释了电机代码、因此我可以通过中断以15KHz 使用 ADC12、从而根据电机演示代码触发 ADC12捕获。

我正在探索空闲、停止、待机。 HALT 和 STANDBY 代码正常运行。 我无法空闲正常工作,我尝试禁用中断,但没有成功..... 我错过了什么吗?

// 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(;;) {}

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    您可以查看 C2000Ware 中的示例,尝试在 RAM 中运行 enterLPM()函数,然后关闭闪存组以进入空闲模式。

    C:\ti\c2000Ware_3_04_00_00\driverlib\f28004x\examples\lpm

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    //============================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================
    //============================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================ RVP_ResetMCU
    //用途:用于 MCU 复位
    //输入:0 = 90MHz (PPP),1 = 60MHz (PPP),2 = 20MHz (PPL 关闭),3 =空闲,4 =待机,5 =停止。
    //输出:
    //注意:假定安装了20MHz 外部 XOSC。
    //============================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================
    #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;
    开关(SelectFreq)

    情况(3)://IDLE 模式

    //演示代码包括 WAKEUP:C:\ti\c2000Ware_3_03_00_00\device_support\f2806x\examples\c28\lpm_idlewake
    //我们仅运行以测量电流。

    Dint;
    WDOG_DISABLE (uhal->wdogHandle);
    WDOG_disableInt(uhal->wdogHandle);
    cpu_disableDebugInt (uhal->cpuHandle);
    cpu_disableGlobalInts (uhal->cpuHandle);
    //uhal->压 电致->PIEIEIER PIEIFR[0].IER &=~10;//禁用 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)//仅在 PLL 不处于跛形模式时进入空闲模式。

    SysCtrlRegs.LPMCR0.bit.LPM = 0x0000;// LPM 模式=空闲

    EDIS;
    Flash_setPowerMode (uhal->flashHandle、flash_powermode_PumpAndBankSleep);
    _asm (" idle");//设备在空闲状态下等待
    for (;;){}
    #pragma diag_suppress=112
    中断;
    #pragma diag_default=112

    上述代码已按建议修改,代码位于 RAM 中,闪存置于睡眠状态..... 但未能在那里闲置。

    建议?

    R.  

    注意:我无法使用插入代码功能、因为它会崩溃。  

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    我还在空闲前清除了所有 PIE 标志和 ACK (全部为0x0000)、并包括断开 XDS200器件的连接。 它不会保持空闲。  

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    我假设您的问题不是进入空闲状态、而是保持空闲状态。 很明显、某些中断(或 GPIO 引脚上的活动)会唤醒器件。 请查找任何类型的中断或引脚活动;这应该是根本原因。