PWM on UP xtreme

stevenjameson
New Member Posts: 11 ✭
Hi
Setting the PWM Value without using windows.devices.pwm
Upbridge and eapi.dll have this function
EApiPwmSetValue(pin, PWMBaseint, PWMFraction, PWMDuty)
All I need to speed everything up in terms on development is the equation for converting a frequency into the PWMBaseint and PWMFraction
Can you help?
Thanks
Steven
Answers
-
@stevenjameson
UP Xtreme PWM frequency is 128 ~ 16000 , PWM formula as following
PWMBaseint = Frequency * 256 / 32000
PWMFraction =((Frequency % 125)/125) * 16384
PWMDuty is 0~255 levelsNotice: not any frequency in the range is supported.