Something about configuring GPT may be wrong in MCUXpresso Config Tools

cancel
Showing results for 
Search instead for 
Did you mean: 

Something about configuring GPT may be wrong in MCUXpresso Config Tools

211 Views
121511296
Contributor I

Hey,   Recently while i use MCUXpressoIDE & MCUXpresso Config Tools to generate GPT1 & GPT2 configurations automatically for my project, I found out there may be something incorrect about `compare value`, showing as follows:

121511296_2-1601027157579.png

 

And my IRQ shows like this:

```C

extern "C" void GPT1_IRQHandler()
{
/* Clear interrupt flag.*/
GPT_ClearStatusFlags(GPT1_PERIPHERAL, kGPT_OutputCompare1Flag);
TOGGLE(GPIO_AD_B1_06);

/* Add for ARM errata 838869, affects Cortex-M4, Cortex-M4F Store immediate overlapping
exception return operation might vector to incorrect interrupt */
#if defined __CORTEX_M && (__CORTEX_M == 4U)
__DSB();
#endif
}


extern "C" void GPT2_IRQHandler()
{
/* Clear interrupt flag.*/
GPT_ClearStatusFlags(GPT2_PERIPHERAL, kGPT_OutputCompare1Flag);
TOGGLE(GPIO_AD_B1_07);

/* Add for ARM errata 838869, affects Cortex-M4, Cortex-M4F Store immediate overlapping
exception return operation might vector to incorrect interrupt */
#if defined __CORTEX_M && (__CORTEX_M == 4U)
__DSB();
#endif
}

```

Then I captured the pin logic, like this:

121511296_1-1601027071127.png

121511296_3-1601027316285.png

Then I realized that same thing happened before while i use the same processor and same gpt, which is that the actual compare value is 1 more than its setting value, while it cannot be set as zero in MCUXpresso Config Tools(showing as follow). So it leads to one more microsecond for every microseconds.(I guess.)

121511296_4-1601027628907.png

 

So, I am a little confused. Am I right about this?

 

 

0 Kudos
1 Reply

195 Views
danielchen
NXP TechSupport
NXP TechSupport

Hi

 

Thank you for your feedback, could you please let me know which MCU and the SDK version you are using?

 

Regards

Daniel

0 Kudos