pwm solution if the frequency and accuracy requirements are not high can be soft timer implementation, hard implementation is basically a timer 4, you find more than 5 timers on the line,ZE has 6 definitely no problem, in addition, you have to see the manual these outputs are not reusable pins, which depends on your package.