I'm able to get 31ns pulse using compare channel OCnX. But because of 16-bit timer I couldn't get the required frequency levels in few Hz.
From what I understand, you are able to get
31 nS on-time but not
99999969 nS off time (at 10Hz PWM frequency). If I'm not mistaken, you are using timer overflow method to generate an off state. Modify this a bit and you can get extended off time periods.
Use a counter variable!
Let's say the maximum time you can measure with your timer is
t_max = t1 nS, (t1 < 99999969). Do the math and count how many times you will have to overflow the timer to get the required off-time.
Let this number be 5.
Whenever the timer overflows, increment a counter variable. Keep resetting the timer and the incrementing the counter after every timer overflow event till
counter < = 5 (here) i.e. till you reach the desired time value. Keep the PWM pin state LOW until you reach the desired off-time for the PWM pulse
So, in your case, if you are unable to get a delay of 99999969 nS in one overflow event, repeat the process n times times till you attain the desired off-time. Hold the PWM pin LOW until you reach a certain value of counter variable which gives you the required off-time.
t_max = 15nS
t_off = 100nS
i = counter variable
Here, you can measure 15nS of time in one timer overflow event. So you will have to overflow the timer 6 times to get a delay of 90nS and in the next timer interval, you can get a 100nS time measurement. So you have keep overflowing the timer for 6 times i.e.
while (i <= 6), overflow timer;