Need to use delay of 10ms and 100ms in s32k358

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

Need to use delay of 10ms and 100ms in s32k358

243 Views
Gunasekar
Contributor I

Hello all,

I need to make a gpio pin low and need to wait for 10ms and again another gpio as high and need to wait 100ms. How can I do this in s32k358 can someone explain?

0 Kudos
Reply
1 Reply

227 Views
Julián_AragónM
NXP TechSupport
NXP TechSupport

Hi @Gunasekar,

It depends on your application, but you can either use Systick with the OSIF RTD driver, any of the timers (such as PIT, RTD includes the Pit_Gpt_Ip_Example_S32K358, which toggles a LED each second), or a simple blocking delay as the one declared in the Siul2_Dio_Ip_Example

void TestDelay(uint32 delay)
{
    static volatile uint32 DelayTimer = 0;
    while (DelayTimer < delay)
    {
        DelayTimer++;
    }
    DelayTimer = 0;
}

Best regards,
Julián

0 Kudos
Reply