Low power Timer issue

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

Low power Timer issue

3,079 次查看
huaping
Contributor III

How to use LPT two channels?

One channel is ok, but add two, it can't jump to interrupt function, pls help check it.

Also it alwayls show errors, but image file is generated, pls see the attached example and picture.

Original Attachment has been moved to: LowPTimer.zip

标签 (1)
0 项奖励
回复
3 回复数

2,712 次查看
huaping
Contributor III

Dear Daniel:

         Thanks for your reply! this is caused I want to change to channel 2.

        According to your guide, the code is as below:

  void LPIT_ISR1(void)
  {
     LPIT_DRV_ClearInterruptFlagTimerChannels(FSL_LPIT1, (1 <<1));
     GPIO_HAL_TogglePins(PTB,1<<5);

  }

     But it stil can't enter channel 1 interrupt function, even I closed channel 0 as below:

  //  INT_SYS_InstallHandler(48,&LPIT_ISR,(isr_t*)0);
    INT_SYS_InstallHandler(49,&LPIT_ISR1,(isr_t*)0);

    LPIT_DRV_Init(FSL_LPIT1, &lpit1_InitConfig);
  //  LPIT_DRV_InitChannel(FSL_LPIT1, 0, &lpit1_ChnConfig0);
    LPIT_DRV_InitChannel(FSL_LPIT1, 1, &lpit1_ChnConfig1);
   // LPIT_DRV_StartTimerChannels(FSL_LPIT1, (1 << 0));
    LPIT_DRV_StartTimerChannels(FSL_LPIT1, (1 << 1));

    Can you help try in your board?

    Thanks!

0 项奖励
回复

2,715 次查看
danielmartynek
NXP TechSupport
NXP TechSupport

Hi

 

I have tried your code on two boards and it works on the new S32K144EVB-Q100 with N47T. But it doesn’t work on FRDMPK144-Q100 with N77P. I have rewritten the code without SDK, but it doesn’t work either. Although the flag is set, it won’t go into ISR. The problem is in the N77P mask set which is a prototype.   

 

Regards

Daniel

2,715 次查看
danielmartynek
NXP TechSupport
NXP TechSupport

Hi

In ISR of channel 1 you clear TIF2(Channel 2 Timer Interrupt Flag)

LPIT_DRV_ClearInterruptFlagTimerChannels(FSL_LPIT1, (1 <<2));  // Should be (1 << 1)

I didn’t get any error when I built your project. Have you tried cleaning the project?

Regards

Daniel

0 项奖励
回复