Timer output to a known state after disabling it

Hello everyone,,
I am working on a IR transmitter that requires a 40KHZ modulated frequency. I am using timer1 to generate the 40KHZ and turning it on and off via timer 2. The output of timer 1 ( pin 10 on my Nano) is connected to the LED. The problem that I am having is that when I turn off timer 1, the output needs to be LOW, so the LED goes off. I'm finding that it can be randomly HIGH or LOW. Is there a way to force the output low after I disable the timer?

I have tried using digitalWrite and directly writing to the parallel port registers. I can't seem to use the timer output once I have done that.

Any ideas?

Thanks,
Afjhal.

In setup, set the pin low using

digitalWrite( pinPWM, LOW );

Then, where you stop the PWM, set COM1A1 and COM1A0 in TCCR1A to 0:0. This will disconnect the OCR1A output and return it to normal function. The pin will attain the low state you set in setup.

When you need to activate the PWM again, simply reset the COM1Ax pins as required again.