FreeRTOS delay in microseconds

disideris wrote on Tuesday, May 23, 2017:

Hi there,

I am trying to implement a delay microsecnods functions in terms of FreeRTOS and read different threads in this forum but dint get a clear way through.

I have some basic questions and it would be very helpful if anyone could answer them.

My setup:
I am running FreeRTOS on an NXP LPC4367. So far i have all these tasks running that read different sensors and so on.

I want to make a task that constructs and sends infrared commands. I have figured out the timings and without Freertos it works.

This IR functionality needs a delay microseconds function in order to get built.

So my configTICK_RATE_HZ is default -> (TickType_t) 1000)

  1. Can i implement in terms of FreeRTOS a delaymicrosecnods function?

  2. Freertos makes use of SysTick_Handler. (When i try to make use of SysTick_Handler compiler says that is already used.) Having that trouble i tried to use a peripheral timer that LPC offers. Peripheral timer doesn’t work alongside FreeRTOS.

Any help plz?

Thanks a lot in advance!

rtel wrote on Tuesday, May 23, 2017:

Can i implement in terms of FreeRTOS a delaymicrosecnods function?

Not using the RTOS tick, if it is running at 1KHz, and it is not
recommended to run it faster than that.

Freertos makes use of SysTick_Handler. (When i try to make use of
SysTick_Handler compiler says that is already used.) Having that
trouble i tried to use a peripheral timer that LPC offers.
Peripheral timer doesn't work alongside FreeRTOS.

Using a peripheral timer would be my initial advice. FreeRTOS doesn’t
touch any other timers so it should work.

glenenglish wrote on Friday, May 26, 2017:

Use a hardware timer, and interrupt.

in the interrupt, you can yieldfromISR , taskgivefromISR etc

this way you can get a deterministic hard RTOS .
especially if nested interrupts is all working as it should…’
that’s how I fire the firing pin at exactly the time it needs to fire…