Low power Timer issue

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Low power Timer issue

1,491 Views
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

Labels (1)
0 Kudos
3 Replies

1,124 Views
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 Kudos

1,127 Views
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

1,127 Views
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 Kudos