Hello,
Processor: i.MX RT600
On the ARM core (Cortex M33), i am using fsl_ostimer.
I am trying to reset the value of the timer to 0, by command from a user, or SW reset of the proccesor.
I tried using the following, but i doesn't seems to work:
static void OSTIMER_SoftwareReset(OSTIMER_Type * base)
void OSTIMER_Deinit(OSTIMER_Type * base)
void OSTIMER_Init(OSTIMER_Type * base) - (doesn't clear the existing counter)
is it possible?
thanks,
Sergei
解決済! 解決策の投稿を見る。
I think when you call the OSTIMER_SoftwareReset, you need to disable the count at first.
Otherwise, even you reset it, it is still counting, then you don't know whether you reset it or not.
static inline void OSTIMER_SoftwareReset(OSTIMER_Type *base)
{
#if !(defined(FSL_FEATURE_PMC_HAS_NO_OSTIMER_REG) && FSL_FEATURE_PMC_HAS_NO_OSTIMER_REG)
PMC->OSTIMERr |= PMC_OSTIMER_SOFTRESET_MASK;
PMC->OSTIMERr &= ~PMC_OSTIMER_SOFTRESET_MASK;
#endif
}
BTW, you can debug your code, make sure your this code is running:
PMC->OSTIMERr |= PMC_OSTIMER_SOFTRESET_MASK;
PMC->OSTIMERr &= ~PMC_OSTIMER_SOFTRESET_MASK;
You see, code is dark.
I think you can comment the #if #endif.
Wish it helps you!
Best Regards,
Kerry
I think when you call the OSTIMER_SoftwareReset, you need to disable the count at first.
Otherwise, even you reset it, it is still counting, then you don't know whether you reset it or not.
static inline void OSTIMER_SoftwareReset(OSTIMER_Type *base)
{
#if !(defined(FSL_FEATURE_PMC_HAS_NO_OSTIMER_REG) && FSL_FEATURE_PMC_HAS_NO_OSTIMER_REG)
PMC->OSTIMERr |= PMC_OSTIMER_SOFTRESET_MASK;
PMC->OSTIMERr &= ~PMC_OSTIMER_SOFTRESET_MASK;
#endif
}
BTW, you can debug your code, make sure your this code is running:
PMC->OSTIMERr |= PMC_OSTIMER_SOFTRESET_MASK;
PMC->OSTIMERr &= ~PMC_OSTIMER_SOFTRESET_MASK;
You see, code is dark.
I think you can comment the #if #endif.
Wish it helps you!
Best Regards,
Kerry