Hello,
Wondering how I can configure one of the GPTs on the IMXRt1170 to use the 32khz crystal oscillator.
I've previously set it up to use the 24Mhz crystal with following:
/*In clock_config.h*/
void StartGptTimerFreeRun(int number, void (*isr)(void *), void *state)
{
gpt_config_t config = {
.clockSource = kGPT_ClockSource_HighFreq,
.divider = 1U,
.enableRunInStop = true,
.enableRunInWait = true,
.enableRunInDoze = false,
.enableRunInDbg = false,
.enableFreeRun = true,
.enableMode = true,
};
GPT_Init(s_GptBase[number + 1], &config);
AttachIsr(number, kGPT_RollOverFlagInterruptEnable, isr, state);
GPT_StartTimer(s_GptBase[number + 1]);
}
And I can read the time with `GetGptTime` in GeneralPurposeTimer.c
I see I can configure the gpt clock source as
Hello @kale ,
Thank you for your time and for contacting NXP support.
I can recommend in this case the use of the MCUConfig Tools, that will help you to configure this values on a more interactive way. You can access this form the MCUXpresso tool bar under the ConfigTool clocks. Here you will find the clock possible configuration on your device. Please let me know if you have any other question.
Hello @nxf77486 and thank you for your reply.
Yeah, that's good advice. I did indeed look into the config tools and saw surprisingly there was no way to configure the gpt to use the 32khz clock source. So I suppose that answered that question.
Thanks