separated writes in pwmMode as they weren't working together