1.7.26.60 TCCx_PWM16bitPeriodSet Function

C

/* x = TCC instance number */
void TCCx_PWM16bitPeriodSet ( uint16_t period );

Summary

Sets the period value of a given TCC instance.

Description

This function writes the period value. Period value is shared between all the channels of TCC instance. When counter matches period value interrupt can be generated. This function writes to the double buffered register. Actual update happens on period match or zero match.

Precondition

TCCx_PWMInitialize and TCCx_PWMStart function must have been called first for the given channel.

Parameters

Param Description
period Period value. Counter increments till this value

Returns

None.

Example

TCC0_PWMInitialize();
TCC0_PWMStart();
TCC0_PWM16bitPeriodSet(0x500ul);

Remarks

This function waits till sync operation is complete. TCC should be running to write to double buffered period register.