50Hz on Timer 5 of mega2560 R3

Hello,

I'm trying to change the frequency of timer 5 to 50 Hz the following way but I don't get an output (on the oscilloscope):

const byte servo = 45;

void setup()
{

pinMode(servo,OUTPUT);
// initialize Timer5
cli(); // disable global interrupts
TCCR5A = 0; // set entire TCCR1A register to 0
TCCR5B = 0; // same for TCCR1B

// set compare match register to desired timer count:
//313 = 50 Hz
//156 = 100 Hz
//80 = 200 Hz
OCR5A = 313;
// turn on CTC mode:
TCCR5B |= (1 << WGM52);
// Set CS50, CS51, CS52 bits for prescaler value: 1024
TCCR5B |= (1 << CS50);
TCCR5B |= (0 << CS51);
TCCR5B |= (1 << CS52);
TCCR5B |= (1 << CS12);
// enable timer compare interrupt:
TIMSK5 |= (1 << OCIE5A);
sei(); // enable global interrupt
}

void loop{

analogWrite (servo,12);
}

Currently I'm using an adafruit touchscreen that takes most of my pins away, so I only have access to pins 44, 45, 46 to generate a pwm output. I've tried using the servo.write function as well as the writemicroseconds function to generate a signal but I have issues with the output pwm signal (it goes to a high resolution servo and it appears that the counter is off sometimes, causing noise due to the servo trying to compensate). Therefore, I'm planning on using analogWrite to generate the duty cycle and timer5 to generate the frequency. Is this wise, or is there a better alternative to doing this? (PS... I have changed the value of timer5 using a prescalar (TCCR5B = (TCCR5B & 0xF8) | 0x05) which outputs 30Hz, but I need a way to output 50Hz) Thank You.

pin 45 is OCR5B, not OCR5A

[edit: ignore the above, I should have read a bit more carefully! ]

Basically you are using CTC mode which doesn't do PWM... Use mode 15 (frequency accurate fast PWM) perhaps?