- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
I'm using CYBLE-416045-02 mcu and want to change PWM Alignment during run time.
Please Help.
Thanks
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
AyKo,
If you allocated the PWM at the HAL-level, then you can make a call to cyhal_pwm_init_adv() (Hardware Abstraction Layer (HAL) ) In this call, there is a parameter for alignment.
You will probably have to perform a cyhal_pwm_free() first to have the halmgr free up the resources on the previously allocated PWM resource.
If you allocated the PWM at the PDL-level, I believe you need to perform the following steps:
- Cy_TCPWM_PWM_Disable();
- Cy_TCPWM_PWM_DeInit();
- change the .pwmAlignment varaible in the cy_stc_tcpwm_pwm_config_t to the alignment type you want.
- Cy_TCPWM_PWM_Init();
- Cy_TCPWM_PWM_Enable();
Len
"Engineering is an Art. The Art of Compromise."
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
AyKo,
If you allocated the PWM at the HAL-level, then you can make a call to cyhal_pwm_init_adv() (Hardware Abstraction Layer (HAL) ) In this call, there is a parameter for alignment.
You will probably have to perform a cyhal_pwm_free() first to have the halmgr free up the resources on the previously allocated PWM resource.
If you allocated the PWM at the PDL-level, I believe you need to perform the following steps:
- Cy_TCPWM_PWM_Disable();
- Cy_TCPWM_PWM_DeInit();
- change the .pwmAlignment varaible in the cy_stc_tcpwm_pwm_config_t to the alignment type you want.
- Cy_TCPWM_PWM_Init();
- Cy_TCPWM_PWM_Enable();
Len
"Engineering is an Art. The Art of Compromise."