Hi surender elumalai,
Seems that you want to update PWM duty cycle according to the ADC value.
You don't need to initialize pwm(pwm_init) every time, The pwm_init only need to run one time in main function.
What you need to do is just update the duty cycle in ADC16_SE4_IRQ_HANDLER_FUNC.
TPM_UpdatePwmDutycycle can be use to achieve it.
For example:
TPM_UpdatePwmDutycycle(BOARD_TPM_BASEADDR, BOARD_TPM_CHANNEL_PAIR, kTPM_CombinedPwm, updatedDutycycle);
Best Regards,
Robin
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------