AnsweredAssumed Answered

K64F GPIO API

Question asked by shaul dorf on Sep 27, 2018
Latest reply on Oct 7, 2018 by Alice_Yang

I'm trying to migrate my old project implemented in KDS3.2 (with PE) to MCUXpresso.

Using Bits1_PutVal(Bits1_Ptr…… instructions I have delayed "Low" sequence between four Outputs.

 

As a test case I prepared small direct register access program which is working well

While(1)

{

GPIOD->PDOR = 0x1;

DELAY;

GPIOD->PDOR = 0x2;

DELAY;

GPIOD->PDOR = 0x4;

DELAY;

GPIOD->PDOR = 0x8;

DELAY;

}

 

When I tried to implement the above using API the only solution that I found is adding additional GPIO_ClearPinsOutput() which clears all outputs

While(1)

{

GPIO_SetPinsOutput(GPIOD, 0x1);

DELAY;

GPIO_ClearPinsOutput(GPIOD, 0x1);

GPIO_SetPinsOutput(GPIOD, 0x2);

DELAY;

GPIO_ClearPinsOutput(GPIOD, 0x2);

GPIO_SetPinsOutput(GPIOD, 0x4);

DELAY;

GPIO_ClearPinsOutput(GPIOD, 0x4);

GPIO_SetPinsOutput(GPIOD, 0x8);

DELAY;

GPIO_ClearPinsOutput(GPIOD, 0x8);

}

 

GPIO_ClearPinsOutput clears all outputs for about 0.5 usec which is not acceptable.

 

The question is if I missed something in fsl_gpio.h   API?

 

Thanks

Shaul

Outcomes