The frequencies are variable starting at 0,1 Hz and ending at 10000 Hz.
That is a pretty wide range ie 100000:1 which won't be directly possible with 16-bit (65535:1) timers. But you could split it into two ranges, say 0.1 to 32 Hz and 32 Hz to 10,000 Hz, and so if we deal with the lower range first:
It looks like there are three identical 16-bit timer/capture/compare modules, called TC1, TC3 and TC4. Let's use TC3.
I don't know what the timer clock frequency is exactly - it depends on the system clock crystal frequency - but usually it's around 1 MHz. For the lower range, we'd prescale that by 256, which would be a timer clock of 3906.25 Hz, and the timer would count from 0 to 65535 in a bit over 16 seconds, which is comfortably longer than your 0.1 Hz minimum frequency period of 10 seconds.
Each module has two compare values, which can be used to alter a compare output (your frequency output) when the timer equals a set value. One of the compare values can also reset the timer back to zero.
So what you'd do if you wanted say 7 Hz with a 37% duty cycle is:
first calculate the total period count = 3906.25 Hz timer clock / 7 Hz = 558.035714 = 558 timer ticks (so our actual output frequency would be 7.000448 Hz)
then calculate the high period count = 558 ticks x 37% = 206.46 = 206 timer ticks (thus our actual duty cycle would be 36.917563%, ie maximum relative error of 0.5 / 558)
and then you'd set OCR3A to 558, to set the output high *and* reset TC3 to 0 when it reaches 558,
and set OCR3B to 206, to set the output low after it has been high for 206 ticks (timer counts 0 to 205)
I might have the highs and lows the wrong way around, but I'll leave the fine polishing for you ✌ the general plan is good ?
For output frequencies in the higher range (32 Hz to 10000 Hz) you'd change the prescaler from 1/256 to 1/1 so that the timer clock is now 1000000 Hz instead of 3906.25 Hz, and calculate the total and high period counts accordingly.
You should only need to do those calculations when you want to change the frequency or duty cycle. And if you are only changing the duty cycle, you don't need to recalculate total period count... bonus! Once you've got the timer set up, it'll generate your signal continuously all by itself, while your program can go off and do its own thing. I'm pretty sure it'll work without needing an interrupt handler to update anything.
You could probably split your output range into three bands, and use three prescalers 1/256, 1/16 and 1/1, to give you better frequency and duty cycle resolution. Higher period counts = better resolution.