TI中文支持网
TI专业的中文技术问题搜集分享网站

TMS320F28377D: 测试官方例程clb_ex11_interrupt_tag无法进入中断,编译与调试无报错信息。

Part Number:TMS320F28377DOther Parts Discussed in Thread:SYSCONFIG

在调试clb_ex11_interrupt_tag例程,发现无法进入中断,详细如下:

这段代码主函数是一个while空循环,只是CLB模块内有个计数器在两个比较匹配值时会触发中断,理论上就会进入ISR。编译、下载、调试、运行都不报错,但就是不进入ISR,得到不预期功能。

期待官方能解答一下。

参考:www.ti.com/…/spruir8a.pdf

//#############################################################################
//
// FILE:clb_ex11_interrupt_tag.c
//
// TITLE:  CLB Interrupt Tag.
//
//! \addtogroup driver_example_list
//! <h1>CLB Interrupt Tag</h1>
//!
//! For the detailed description of this example, please refer to: 
//!  C2000Ware_PATH\utilities\clb_tool\clb_syscfg\doc\CLB Tool Users Guide.pdf
//!
//
//
//#############################################################################
//
// $Release Date: $
// $Copyright:
// Copyright (C) 2013-2023 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
//distribution.
// 
//Neither the name of Texas Instruments Incorporated nor the names of
//its contributors may be used to endorse or promote products derived
//from this software without specific prior written permission.
// 
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
// $
//#############################################################################



#include "driverlib.h"
#include "device.h"
#include "clb_config.h"
#include "clb.h"

__interrupt void clb1ISR(void);

#define COUNTER0_TIMER_ENABLE0x1


#define COUNTER0_INT_TAG11
#define COUNTER1_INT_TAG12


void main(void)
{Device_init();Device_initGPIO();Interrupt_initModule();Interrupt_initVectorTable();Interrupt_register(INT_CLB1, &clb1ISR);Interrupt_enable(INT_CLB1);//// Enabling EPWM1 to enable CLB1//
	SysCtl_enablePeripheral(SYSCTL_PERIPH_CLK_EPWM1);CLB_enableCLB(CLB1_BASE);initTILE1(CLB1_BASE);//// Select Global input instead of local input for all CLB IN//CLB_configLocalInputMux(CLB1_BASE, CLB_IN0, CLB_LOCAL_IN_MUX_GLOBAL_IN);CLB_configLocalInputMux(CLB1_BASE, CLB_IN1, CLB_LOCAL_IN_MUX_GLOBAL_IN);CLB_configLocalInputMux(CLB1_BASE, CLB_IN2, CLB_LOCAL_IN_MUX_GLOBAL_IN);CLB_configLocalInputMux(CLB1_BASE, CLB_IN3, CLB_LOCAL_IN_MUX_GLOBAL_IN);CLB_configLocalInputMux(CLB1_BASE, CLB_IN4, CLB_LOCAL_IN_MUX_GLOBAL_IN);CLB_configLocalInputMux(CLB1_BASE, CLB_IN5, CLB_LOCAL_IN_MUX_GLOBAL_IN);CLB_configLocalInputMux(CLB1_BASE, CLB_IN6, CLB_LOCAL_IN_MUX_GLOBAL_IN);CLB_configLocalInputMux(CLB1_BASE, CLB_IN7, CLB_LOCAL_IN_MUX_GLOBAL_IN);//// Unused Inputs below//CLB_configGlobalInputMux(CLB1_BASE, CLB_IN0, CLB_GLOBAL_IN_MUX_EPWM1A);CLB_configGlobalInputMux(CLB1_BASE, CLB_IN1, CLB_GLOBAL_IN_MUX_EPWM1A);CLB_configGlobalInputMux(CLB1_BASE, CLB_IN2, CLB_GLOBAL_IN_MUX_EPWM1A);CLB_configGlobalInputMux(CLB1_BASE, CLB_IN3, CLB_GLOBAL_IN_MUX_EPWM1A);CLB_configGlobalInputMux(CLB1_BASE, CLB_IN4, CLB_GLOBAL_IN_MUX_EPWM1A);CLB_configGlobalInputMux(CLB1_BASE, CLB_IN5, CLB_GLOBAL_IN_MUX_EPWM1A);CLB_configGlobalInputMux(CLB1_BASE, CLB_IN6, CLB_GLOBAL_IN_MUX_EPWM1A);CLB_configGlobalInputMux(CLB1_BASE, CLB_IN7, CLB_GLOBAL_IN_MUX_EPWM1A);//// Inputs set to GP register//CLB_configGPInputMux(CLB1_BASE, CLB_IN0, CLB_GP_IN_MUX_GP_REG);CLB_configGPInputMux(CLB1_BASE, CLB_IN1, CLB_GP_IN_MUX_GP_REG);CLB_configGPInputMux(CLB1_BASE, CLB_IN2, CLB_GP_IN_MUX_GP_REG);CLB_configGPInputMux(CLB1_BASE, CLB_IN3, CLB_GP_IN_MUX_GP_REG);CLB_configGPInputMux(CLB1_BASE, CLB_IN4, CLB_GP_IN_MUX_GP_REG);CLB_configGPInputMux(CLB1_BASE, CLB_IN5, CLB_GP_IN_MUX_GP_REG);//// Unused inputs to GP register//CLB_configGPInputMux(CLB1_BASE, CLB_IN6, CLB_GP_IN_MUX_GP_REG);CLB_configGPInputMux(CLB1_BASE, CLB_IN7, CLB_GP_IN_MUX_GP_REG);//// Configure GPIO0 for Output//GPIO_setPinConfig(GPIO_0_GPIO0);GPIO_setDirectionMode(0, GPIO_DIR_MODE_OUT);GPIO_setPadConfig(0, GPIO_PIN_TYPE_STD);//// Configure GPIO1 for Output//GPIO_setPinConfig(GPIO_1_GPIO1);GPIO_setDirectionMode(1, GPIO_DIR_MODE_OUT);GPIO_setPadConfig(1, GPIO_PIN_TYPE_STD);//// Configure GPIO24 for OUTPUTXBAR1//GPIO_setPinConfig(GPIO_24_OUTPUTXBAR1);GPIO_setDirectionMode(24, GPIO_DIR_MODE_OUT);GPIO_setPadConfig(24, GPIO_PIN_TYPE_STD);//// Configure GPIO16 for OUTPUTXBAR7//GPIO_setPinConfig(GPIO_16_OUTPUTXBAR7);GPIO_setDirectionMode(16, GPIO_DIR_MODE_OUT);GPIO_setPadConfig(16, GPIO_PIN_TYPE_STD);//// Configure OUTPUT-XBAR OUTPUT1 as CLB1_OUT4//XBAR_setOutputMuxConfig(XBAR_OUTPUT1, XBAR_OUT_MUX01_CLB1_OUT4);XBAR_enableOutputMux(XBAR_OUTPUT1, XBAR_MUX01);//// Configure OUTPUT-XBAR OUTPUT7 as CLB1_OUT5//XBAR_setOutputMuxConfig(XBAR_OUTPUT7, XBAR_OUT_MUX03_CLB1_OUT5);XBAR_enableOutputMux(XBAR_OUTPUT7, XBAR_MUX03);CLB_setGPREG(CLB1_BASE, COUNTER0_TIMER_ENABLE);//// Enable Global Interrupt (INTM) and realtime interrupt (DBGM)//EINT;ERTM;CLB_clearInterruptTag(CLB1_BASE);while(1){asm(" NOP");}
}


__interrupt void clb1ISR(void)
{uint16_t tag = CLB_getInterruptTag(CLB1_BASE);if (tag == COUNTER0_INT_TAG){GPIO_togglePin(0);}if (tag == COUNTER1_INT_TAG){GPIO_togglePin(1);}CLB_clearInterruptTag(CLB1_BASE);Interrupt_clearACKGroup(INTERRUPT_ACK_GROUP5);
}

Yale Li:

F28377D上没有CLB:

zhcsc63o_TMS320F2837xD 双核微控制器 datasheet (Rev. O) P7:6 器件比较

,

HWAN XU:

拜托你们用关键词”28377D CLB“搜一下这个论坛里有多少个相关的问题了,很多人都被sysconfig带坑里去了,你们还说因为sysconfig处于初期阶段,最早的问题提出都是三四年前了,你们工程师竟然还答复说因为别人的硬件有问题((+) TMS320F28377D: ePWM using CLB Tool – C2000 microcontrollers forum – C2000Tm︎ microcontrollers – TI E2E support forums),你们为啥还不能在ccs/sysconfig里把28377D不支持的功能屏蔽掉啊!

,

HWAN XU:

(+) TMS320F28377D: ePWM generation using CLB Tool – C2000 microcontrollers forum – C2000Tm︎ microcontrollers – TI E2E support forums

,

Yale Li:

我不是相关的开发人员,我也只能尽我所能将这些反馈到相关的人员那里

赞(0)
未经允许不得转载:TI中文支持网 » TMS320F28377D: 测试官方例程clb_ex11_interrupt_tag无法进入中断,编译与调试无报错信息。
分享到: 更多 (0)

© 2024 TI中文支持网   网站地图 鲁ICP备2022002796号-1