There is an difference between the wait time specified to dly_tsk and the actual wait time.
(Specified wait time [ms] = Delay time [tick] x Clock interrupt period [ms])
The actual wait time, including the difference, is as follows.
(Specified wait time − Clock interrupt period) < Actual wait time < Specified wait time
The difference occurs because the minimum time unit in which the RX850 controls time is the clock interrupt period.
This applies not only to dly_tsk but also to all the time control functions of the RX850.
In the above example, the actual wait time is about 20 to 30 ms because the clock interrupt period is 10 ms
and the specified wait time is 30 ms.
Example 1: Clock interrupt period = 10 ms
dly_tsk(3); //20 ms < Actual wait time < 30 ms
To delay task processing at least 30 ms, the minimum value of the actual wait time should be longer than 30 ms.
Example 2: Clock interrupt period = 10 ms
dly_tsk(4); //30 ms < Actual wait time < 40 ms
To strictly delay task processing 30 ms, the difference should be minimized.
This can be done by shortening the clock interrupt period.
Example 3: Clock interrupt period = 1 ms
dly_tsk(30); //29 ms < Actual wait time < 30 ms