Output Compare Init

Initializes the timer module.

Description

As a prerequisite to other time output related blocks being used, the 'Output Compare Init' block must be added. The initialisation is for a specific TIM module. When this block if present, time output related block can be used for those channels (up to 4, hardware dependent) belonging to the TIM module.

For the 'Output Compare Init' block, a frequency need to be specified. This is the frequency at which the timer module's internal 16-bit free running counter counts. For example: If a frequency of 1MHz is specified, each the free running counter increments every 1 microsecond. The counter overflows at 65535 to 0, so the time between overflow is then 65.536 milliseonds.

If desired, a function call subsystem can be connected to the output of the 'Output Compare Init' block. This subsystem is then automatically called each time the free running overflows. Keep in mind that this subsystem is called at interrupt level, so take special care when sharing data between this subsystem and the rest of the Simulink model.

Output

Allows connection of a function call subsystem that is executed each time the free running counter overflows.

Parameters
Timer module
Selects the timer module.

Frequency
Frequency at which the 16-bit free running counter counts.
Enable IRQ output
Controls whether or not the IRQ output is available.