Question
PWM configuration structure
Posted on April 03, 2015 at 08:01
I am using SPC560D40L3 with SPC5Studio. I am trying to generate a PWM signal. Using Application configuration, I configured the HAL drivers to generate a PWM of 5Hz. Here, I configured the clock frequency and period for the PWM using application configuration which gets stored to structure 'PWMConfig pwm_config'.
Now I want to use a runtime value for PWM frequency i.e. my device will get input for PWM frequency (say via UART) and will use the same for 'PWMConfig pwm_config'. How to pass the clock frequency and period values (derived from PWM frequency) to this structure? Is there any other way to implement this?Thanks in advance.Mike. #pwm-configuration