Create a delay in s32k118 using gpt start timer

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

Create a delay in s32k118 using gpt start timer

836 Views
Ashish4525
Contributor II

Dear all

I am trying to build delay of 1 ms using GPT start timer and I am using LPIT0ch0, I have enable even LPITIrqn via NVICISER0.

I have called enableiRq and passed lpit as arguments.please go through my code once.

Can anyone help me?

0 Kudos
4 Replies

797 Views
Ashish4525
Contributor II

Dear Julian

I am trying to debug to check whether isr has come up or not, while loop is executing once.but going to default isr.any suggestion how to check interrupt is running or not .

0 Kudos

778 Views
Julián_AragónM
NXP TechSupport
NXP TechSupport

Hi @Ashish4525,

You can place a breakpoint inside your interrupt handler to confirm it is indeed running. For example, if you flash the lpit_periodic_interrupt_s32k118 example, you can place the breakpoint inside LPIT_ISR and confirm the isr is active:

Julin_AragnM_0-1710456322958.png

Julin_AragnM_1-1710456399381.png

Best regards,
Julián

0 Kudos

808 Views
Ashish4525
Contributor II

Dear julian

I am trying to make a delay using autosar i have generated all the files for mcu gpt and port so can you tell me api to call in main function,so that I come to know delay is working.

with regards

Ashish

0 Kudos

815 Views
Julián_AragónM
NXP TechSupport
NXP TechSupport

Hi @Ashish4525,

I see you have posted a similar thread on the community; I will try to answer them both on this post.

You are using EB Tresos along with SW32K1_RTD, is this correct? If so, please take a look into the EB examples for the S32K118; 

  • Ftm_Gpt_Example_S32K118
  • Gpt_example_S32K118
  • Lpit_Gpt_Example_S32K118

The Lpit_Gpt_Example_S32K118 application uses the IP layer functionality to trigger a timer interrupt. Notification function increase a count variable by 1 and toggle state pin LED on board.

Please try this example for the GPT Pit interruption.

Best regards,
Julián

 

0 Kudos