How to prevent the microcontroller reset?

Sounds like a power problem, drawing too much current at larger duty cycles. How are you powering the board. An external power supply is the most likely solution.

Lefty