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

sysBios下gpio不触发

请教专家,工程中main.c如下,在中断函数myIsr7没有执行,请问这个是什么原因,谢谢!

#include <xdc/std.h>
#include <xdc/runtime/System.h>
#include <xdc/runtime/Error.h>
#include <ti/sysbios/hal/Hwi.h>
#include <ti/sysbios/BIOS.h>

unsigned int  count_gpio;

Void myIsr7(UArg arg)
{
      count_gpio++;
}

void main()
{
inint();  //初始化PLL,其他接口
setGpio();
BIOS_start();
}

//下面是配置GPIO

#define GPIO 0x02320000
#define GPIOEN (*(volatile unsigned int*)0x02320008)
#define GPIODIR (*(volatile unsigned int*)0x02320010)
#define GPIORIS (*(volatile unsigned int*)0x02320024)
#define GPIOCLR (*(volatile unsigned int*)0x02320028)

#define INTMUX1 (*(volatile unsigned int*)0x01800104)
#define INTMUX2 (*(volatile unsigned int*)0x01800108)
#define INTMUX3 (*(volatile unsigned int*)0x0180010c)
#define EVTCLR (*(volatile unsigned int *)0x01800048)
void setGpio(void)
{
// config gpio pin
GPIOEN = GPIOEN | 0x1;
GPIODIR = 0;
GPIODIR = GPIODIR | (1<<0) | (1<<8) |(1<<9);
GPIORIS = GPIORIS | (1<<0) | (1<<8) |(1<<9);

//23-16BIR 写值 90, GIO8为evt82, gio为evt83,

INTMUX1 &= 0xffff; //高16bit为0
INTMUX2 &= 0xFFFFFF00;//
INTMUX1 |= (0x5a<<16);
INTMUX1 |= (0x52<<24);
INTMUX2 |= 0x53;

ISTP = 0x800000; // ;
TSR = TSR|1; //enable GIE
//enable dsp inturrupt
IER |= 0x2 ; // enable NMI
IER = IER |(1<<7);//开启CPU7号中断
}

下面是cfg文件内容

xdc.useModule('ti.sysbios.BIOS');

xdc.useModule('xdc.runtime.System');

/* Get handle to Hwi module for static configuration */
var Hwi = xdc.useModule('ti.sysbios.hal.Hwi');
var hwiParams = new Hwi.Params; 
hwiParams.arg = 10; 
hwiParams.enableInt = false; 

Hwi.create(7, '&myIsr7', hwiParams);

jian zong1:

请教TI大神,这个GPIO8,不触发是什么原因?

Thomas Yang1:

回复 jian zong1:

一般中断不触发原因可以从trigger source和中断挂接两个方面来分析。

你可以先查看下GPIO的flag标志看正常置位没有,然后查看128event enable register, 和IER,IFR寄存器看相应bit置上没有。

其他中断能正常相应吗?

赞(0)
未经允许不得转载:TI中文支持网 » sysBios下gpio不触发
分享到: 更多 (0)