delay header

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

delay header

733 次查看
vahidnoori
Contributor II

hiii.

i seek to header file of Delay for k20d50. help me plz:smileycool:

标签 (1)
标记 (2)
4 回复数

526 次查看
vahidnoori
Contributor II

hi ping.

this function( LPLD_LPTMR_DelayMs(uint16 period_ms)) did not work correctly . when program go to this function stop and do not rich to the next line after delay function.for example in this:

main{

LPLD_LPTMR_DelayMs(500);

code A;

}

code A dose not performed.

why ?:smileycry:

0 项奖励

526 次查看
jeremyzhou
NXP Employee
NXP Employee

Hi Vahid,

Sorry for late reply, I suggest that you'd better debugger the project by IDE software to figure out the exactly problem.

I'm looking forward your reply.

Best regards,

Ping

0 项奖励

526 次查看
jeremyzhou
NXP Employee
NXP Employee

Hi Vahid,

Do you want to a delay function for K20D50? If it's right, you can use LPMR to make it out as below show .

Best regards,

Ping

void LPLD_LPTMR_DelayMs(uint16 period_ms)

{

  if(!period_ms)

    return;

  SIM_SCGC5|=SIM_SCGC5_LPTIMER_MASK;

  LPTMR0_CMR = period_ms;

  LPTMR0_PSR = LPTMR_PSR_PCS(1)|LPTMR_PSR_PBYP_MASK;

  LPTMR0_CSR |= LPTMR_CSR_TEN_MASK;

  while (!(LPTMR0_CSR & LPTMR_CSR_TCF_MASK));

  LPTMR0_CSR &= ~LPTMR_CSR_TEN_MASK;

  return;

}

526 次查看
vahidnoori
Contributor II

yes .exactly ping.

0 项奖励