Software Timers

Just a general question I need a couple timers for a Modbus Slave RTU application. The Modbus spec states that between Modbus frames there is a minimum time of 3.5 times character length and inter byte timeout of 1.5 times character length. So, at 9600 baud 3.5 times character is about 4ms and inter byte timeout of 1.8 ms. Could I get away with using the FreeRTOS software timers? I am using an ARM-M3 EFM32gg990

Software Timers

That depends on your tick frequency – if the tick is 1KHz (a frequency often used in demos, but faster than most applications) then you can have a timer period with 1ms resolution. Remember the first ms can be between 0.0001ms and 0.99999ms, if the command is received immediately before a tick interrupt or immediately after, so as you need a minimum of 4ms should should have the timer set to 5ms, likewise as you need the minimum of 1.8ms should should set the timer for 3ms.