Application example 1: Multiple interrupts using HW ISR

With the HW ISR, it is easy to implement multiple interrupts. Conventionally, multiple interrupts have been implemented by assigning a priority to each interrupt signal. In the HW ISR, multiple interrupts are implemented according to the priority of tasks that are activated. A lower value indicates a higher priority level in the following figure. In the example shown below task A has the highest priority. Three interrupt lines are set to use the HW ISR to execute the API to release semaphore 6, semaphore 3, and semaphore 4 respectively. Multiple interrupts are processed as they occur according to the priority of the waiting tasks.

Image
HW-RTOS Application example 1: Multiple interrupts using HW ISR

Application example 2: Cyclic activation task

HW-RTOS does not have a cyclic handler function. However, equivalent function can be achieved using an HW ISR. What's more, the start-up time of a cyclic activation task that uses an HW ISR is shorter than that of a cyclic handler running on conventional software RTOS. The procedure is simple: define the input to the HW ISR as the output of the built-in timer of a device with embedded R-IN engine. In the example shown in the below figure, task A is a cyclic activation task. Since the worst-case start-up time is 3.5 microseconds at 100 MHz operation, cyclic processing with an extremely high level of real-time performance can be achieved.

Image
HW-RTOS Application example 2: Cyclic activation task

By building a system that includes the multiple interrupt handling shown in application example 1, you can run multiple cyclic activation tasks. The figure below shows two cyclic activation tasks. Task B is a cyclic activation task with a period five times the length of that of task A. In fact, it is possible to define three or more cyclic activation tasks. The periods of each task do not have to synchronize with each other. It is also possible to trigger cyclic activation from an external pin.

Image
HW-RTOS Application example: Two cyclic activation tasks

Application example 3: Using cyclic activation task for network synchronization

Renesas devices equipped with the R-IN engine have IEEE1588 support function in hardware. By installing IEEE1588 protocol software, you can perform time synchronization between stations that are connected via a network. By inputting a synchronization signal into a timer and using the method shown in application example 2, you can synchronously activate cyclic tasks over HW-RTOSs that are connected via a network. The fluctuation of start-up of a cyclic task is very small, and in the worst case is a delay of 3.5 microseconds added onto the fluctuation of IEEE 1588. Time synchronization can also be implemented using EtherCAT.

Image
HW-RTOS Application example 3: Using cyclic activation task for network synchronization