在线时间49 小时
UID3351331
注册时间2017-2-13
NXP金币0
该用户从未签到
中级会员
 
- 积分
- 390
- 最后登录
- 2017-12-29
|
问题:
为何我还没有对LPTMR模块初始化时他就已经反复进入中断了?
源程序:
int main(void)
/*lint -restore Enable MISRA rule (6.3) checking. */
{
/* Write your local variable definition here */
char Start_flag;
/*** Processor Expert internal initialization. DON'T REMOVE THIS CODE!!! ***/
PE_low_level_init();
/*** End of Processor Expert internal initialization. ***/
while(1)
{
Start_flag=getchar();
if(Start_flag=='s')
{
break;
}
}
MyDacPtr = DA_PTE30_Init(NULL); /* Initialization of DA_PTE30 component */
Error = DA_PTE30_SetValue(MyDacPtr, OutputData); /* Set converter output */
TPM1_Init(); /*TPM Initialization*/
LPTMR_Init(); /*LPTMR Initialization*/
/*************************主循环**************************/
while(1)
{
if((Count_Flag==(Length-1))||(Count_Flag>(Length-1)))
{
DisableInterrupts;
for(Count_Flag=Data_Flag;Count_Flag<(Length-1);Count_Flag++)
{
printf("%d\n", Sampling_Data[Count_Flag]);
}
printf("\n\n\n");
Count_Flag=0;
Data_Flag=0;
EnableInterrupts;
}
else
{
for(;Data_Flag<(Count_Flag-1);Data_Flag++)
{
printf("%d\n", Sampling_Data[Data_Flag]);
}
}
}
/*** Don't write any code pass this line, or it will be deleted during code generation. ***/
/*** RTOS startup code. Macro PEX_RTOS_START is defined by the RTOS component. DON'T MODIFY THIS CODE!!! ***/
#ifdef PEX_RTOS_START
PEX_RTOS_START(); /* Startup of the selected RTOS. Macro is defined by the RTOS component. */
#endif
/*** End of RTOS startup code. ***/
/*** Processor Expert end of main routine. DON'T MODIFY THIS CODE!!! ***/
for(;;){}
/*** Processor Expert end of main routine. DON'T WRITE CODE BELOW!!! ***/
} /*** End of main routine. DO NOT MODIFY THIS TEXT!!! ***/
void LPT_Isr(void)
{
LPT_indicator_NegVal(LPT_indicator_DeviceData); // do this asap - show start of Switch cycle//RED LED
LPTMR0_CSR |= LPTMR_CSR_TCF_MASK; //clear interrupt mask
Channel_switch();
printf("s");
}
LPTMR的PE配置:
最佳答案
胡孟龙 发表于 2017-4-15 11:42
你好,这个链接我也看了。但是并不知道为什么LPTMR会直接进入中断,我希望的是当我初始化后他才正式开启 ...
你把PE模块中的timer enable关了,然后生成代码,等你要使能timer的时候 ...
|
|