The servo code didn't work

Yes that indeed is the problem. @MianQi you are using the registers to set the PWM function of the timers. Why do you want to do this anyway?

Servos are fed with PPM, pulse position modulation. That is where a pulse is generated ever 50mS or so and it is the width of this pulse that controls the servo's position. This can be generated on any pin using the servo library. It seems a waste of time using anything else unless you have a good reason.