more refactoring, logic of the timer code is clearer, added comments
init codebase for pwm, not working yet