I am using FreeRTOS on the RA6M2, and what I need is a fairly accurate detention that works in the range of 1- 64 forevers. The software detention is way out in this range( 60us software detention turned out to be 84us), indeed when using critical task section and disabling irqs.
I have tried rather using a tackle timekeeper like below
This will not be veritably accurate but I was hoping the outflow would be small enough that I could ignore it. still, when I try this, the do while noway exits. For some reason the timekeeper counter keeps resetting indeed though this is a one shot timekeeper. Can someone tell me where I am going wrong with this? I am using the configurator in the e2Studio IDE to set up the timekeeper.
Any results to this problem will be appreciated.
You need to create the callback in the FSP configurator first, then inside your code create its implementation like this: volatile uint8_t timer_done; ....................... /* Example callback called when timer expires. */ void timer_callback (timer_callback_args_t * p_args) { if (TIMER_EVENT_CRead more
You need to create the callback in the FSP configurator first, then inside your code create its implementation like this:
volatile uint8_t timer_done;
.......................
/* Example callback called when timer expires. */
void timer_callback (timer_callback_args_t * p_args)
{
if (TIMER_EVENT_CYCLE_END == p_args->event)
{
timer_done = 1;
}
}
............................
set_output(OUTPUT1, IO_HIGH);
timer_done = 0;
R_GPT_Start(&g_timer0_ctrl);
while (!timer_done);
R_GPT_Reset(&g_timer0_ctrl);