Variable frequency 100 kHz to 1 MHz

So recently I'm trying to build a solid state tesla coil.As my signal generator I want to use an arduino nano.I found some topics about variable frequency fixed duty cycle,but I couldn't understant them.

Can somebody upload a functional code for an arduino nano,which offers variable frequency from 100kHz to 1MHz at a fixed 50% duty cycle?The frequency could be adjusted with a potentiometer if possible...

You are not going to get a variable 1MHz signal off a chip that runs at 16MHz. Well … not without quite a bit of assembly language. Recall that 16MHz is a clock cycle, and that many instructions take several clock cycles to run.

You might be able to write a tight loop that goes exactly at that speed, and to play games with interrupts to exit it. But making it variable? With tests and conditions and sampling the potentiometer with an A/D converter, and doing math to work out when to flip the output? It just ain't going to happen.

I suggest: get some hardware. Control it with an arduino, if that's what you want to do. Or look into FPGAs.

A variable PWM frequency from 100 KHz to 1MHz with a variable duty cycle is easy to achieve with an Arduino DUE (84 MHz).