Low power Timer issue

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

Low power Timer issue

3,081件の閲覧回数
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,714件の閲覧回数
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,717件の閲覧回数
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,717件の閲覧回数
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 件の賞賛
返信