STM32F4x Program explains about duty cycle generation and also simulates the result on Proteus tool for better understanding.
Right-click 'Download' and select 'Save Link As' if the file opens in a new tab.