1.8.22.8 1.25.23.8 1.26.20.8 1.27.23.8 1.28.25.8 1.34.23.8 1.35.16.8 1.36.18.8 1.41.21.8 1.42.20.8 TCx_CHy_TimerCompareSet Function

C

/* x = TC instance number, y= channel number */

/* 16 bit timer */
void TCx_CHy_TimerCompareSet ( uint16_t compare );

/* 32 bit timer */
void TCx_CHy_TimerCompareSet ( uint32_t compare );

Summary

Sets the compare value of a given timer channel.

Description

This function writes the compare value. When timer counter matches compare value, interrupt can be generated.

Precondition

TCx_CHy_TimerInitialize function must have been called first for the given channel.

Parameters

Param Description
compare compare value of the timer (type is based on the bit width of timer)

Returns

None.

Example

TC0_CH1_TimerInitialize();
TC0_CH1_TimerCompareSet(0x500U);

Remarks

This function is available only when TC timer mode is used by SYS_TIME module. SYS_TIME uses compare match interrupt to generate dynamic delay.