Quantcast
Channel: 蓝牙论坛 - 最近的话题
Viewing all articles
Browse latest Browse all 7512

CC2640 IO中断故障问题

$
0
0

我用cc2640做中断,对外面的反应做处理,但是现在我在IO上用逻辑分析仪捕捉的信号是(25Mhz采样,上下跳变均出现,而软件输出并不对应):

而在CCS中debug中输出的信息是(与逻辑分析仪捕捉到的不一致,逻辑分析仪25Mhz采样并未出现干扰,逻辑分析仪中高有效为2.8V,1v以上的都测过,都没有毛刺或干扰):


/*
 * 
 */
static uint32_t InterruptCnt = 0;
static uint32_t InterruptHighCnt = 0;
static uint32_t InterruptLowCnt = 0;

Q_Touch_PAD_STATE Q_Touch_PadState = Q_Touch_PAD_END;
__STATIC_INLINE void Q_Touch_InterruptCallBackFxn(PIN_Handle handle, PIN_Id pinId)
{
	uint_t PinValue;

	CPUdelay(100);	// 100
	PinValue = PIN_getInputValue(Qting_TOUCH_FB_PIN);
	
	if(PinValue == 1)	// high voltage , touched
	{
		CPUdelay(100);	// 100
		PinValue = PIN_getInputValue(Qting_TOUCH_FB_PIN);
		if(PinValue == 1)	// high voltage , touched
		{	
#ifdef Qting_DEBUG
			InterruptHighCnt++;
			System_printf("InterruptHighCnt = %lu\n\n", (ULong)InterruptHighCnt);
			System_flush();
#endif
			Q_Touch_PadState = Q_Touch_PAD_TOUCHED;
		}
		else
			;
	}
	else if(PinValue == 0)	// low voltage , not touch
	{
		CPUdelay(1);	// 100
		PinValue = PIN_getInputValue(Qting_TOUCH_FB_PIN);
		if(PinValue == 0)	// low voltage , not touch
		{
#ifdef Qting_DEBUG
			InterruptLowCnt++;
			System_printf("InterruptLowCnt = %lu\n", (ULong)InterruptLowCnt);
			System_flush();
#endif
			Q_Touch_PadState = Q_Touch_PAD_REMOVED;

			//if(InterruptLowCnt != InterruptHighCnt)
			//	System_printf("Cnt Error! \n");
		}
	}
	else
		;
#ifdef Q_DEBUG
	InterruptCnt++;
	//System_printf("InterruptCnt = %lu\n\n", (ULong)InterruptCnt);
	//System_flush();
	
#endif
}


是否有有人遇到此类问题,或是TI工程师帮忙看看,谢谢了



Viewing all articles
Browse latest Browse all 7512

Trending Articles