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.

TMS320F28388D: CLA中断问题

Part Number: TMS320F28388D

CLA中断对全局变量引用时间相差为什么会这么大?,测试如下两种写法,i = 0;和i = ctrlcla.TADC_Select;,i = ctrlcla.TADC_Select;这种写法会比i=0多费时1.5us,实际控制周期5us,8通道轮询,所以需要用到全局定义,1.5us时间对于5us中断影响太大了。对此有什么好的写法能够解决费时这个问题。(for循环等形式都测试过,只要引用CLA中全局定义的数据好像都会多耗时)

__interrupt void Cla1Task1 ( void )
{
Uint16 i;
GpioDataRegs.GPBSET.bit.GPIO33 = 1;
i = ctrlcla.TADC_Select;
CTRL_Run_exe(&ctrlcla.Channel[i], cla_para.Period,cla_para.Test_flag);
i=i+1;
CTRL_Run_exe(&ctrlcla.Channel[i], cla_para.Period,cla_para.Test_flag);
ctrlcla.TADC_Select=0;
GpioDataRegs.GPBCLEAR.bit.GPIO33 = 1;
}

__interrupt void Cla1Task1 ( void )
{
Uint16 i;
GpioDataRegs.GPBSET.bit.GPIO33 = 1;
i = 0;
CTRL_Run_exe(&ctrlcla.Channel[i], cla_para.Period,cla_para.Test_flag);
i=i+1;
CTRL_Run_exe(&ctrlcla.Channel[i], cla_para.Period,cla_para.Test_flag);
ctrlcla.TADC_Select=0;
GpioDataRegs.GPBCLEAR.bit.GPIO33 = 1;
}

  • CLA中断对全局变量引用时间相差为什么会这么大?

    请问您的 ctrlcla.TADC_Select 是在何处如何定义的?您是否有反汇编查看一下代码的调用情况?

    若是可以,请给出定义的代码或者工程,我们测试一下

  • Fullscreen
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    //#############################################################################
    // \file asin.cla
    //
    // \brief Arc Sine Example
    //
    //#############################################################################
    // $TI Release: F2838x Support Library v3.04.00.00 $
    // $Release Date: Fri Feb 12 19:08:49 IST 2021 $
    // $Copyright:
    // Copyright (C) 2021 Texas Instruments Incorporated - http://www.ti.com/
    //
    // Redistribution and use in source and binary forms, with or without
    // modification, are permitted provided that the following conditions
    // are met:
    //
    // Redistributions of source code must retain the above copyright
    // notice, this list of conditions and the following disclaimer.
    //
    // Redistributions in binary form must reproduce the above copyright
    // notice, this list of conditions and the following disclaimer in the
    // documentation and/or other materials provided with the
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
    Fullscreen
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    //###########################################################################
    //
    // FILE: cla_ex1_asin.c
    //
    // TITLE: CLA Arcsine Example
    //
    //! \addtogroup driver_example_list
    //! <h1>CLA \f$arcsine(x)\f$ using a lookup table (cla_asin_cpu01)</h1>
    //!
    //! In this example, Task 1 of the CLA will calculate the arcsine of
    //! an input argument in the range (-1.0 to 1.0) using a lookup table.
    //!
    //! \b Memory \b Allocation \n
    //! - CLA1 Math Tables (RAMLS0)
    //! - CLAasinTable - Lookup table
    //! - CLA1 to CPU Message RAM
    //! - fResult - Result of the lookup algorithm
    //! - CPU to CLA1 Message RAM
    //! - fVal - Sample input to the lookup algorithm
    //!
    //! \b Watch \b Variables \n
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

  • 实际工程加密无法发送,改的cla_ex1_asin例程

    实际测试相差800ns;

    for(i=num;i!=50;i++)
    {
    text(&ctrl.Channel[i]);
    }

    for(i=0;i!=50;i++)
    {
    text(&ctrl.Channel[i]);
    }

    FLASH模式,开优化如下

  • 实际测试相差800ns;

    抱歉,由于办公室搬迁原因,示波器等设备没有在原办公室,所以目前不好进行测试

    若是您对此问题需要迫切回复的话,请您在英文E2E发帖,谢谢

    https://e2e.ti.com/support/microcontrollers/c2000-microcontrollers-group/ 

  • dsp不是有CLOCK测试时间吗,用这个测试也可以

  • 好的,我会在测试后给您回复

  • 你好,请帮忙回答此问题

  • 抱歉,之前漏掉了您的回复。由于办公室搬迁原因,板子目前不在后边,所以目前不好进行测试

    若是您对此问题需要迫切回复的话,请您在英文E2E发帖,谢谢

    e2e.ti.com/.../