Different square waves from one microcontroller
Each OCnx pin of the ATmega328 can output its own independent PWM waveform. Additionally, each timer ("n") can have its own frequency and/or phase. Additionally, the ATmega328PB has a pin that can output a waveform that is a modulation of two waveforms generated from separate timers.

Since you say "the DC voltage and the period needed can change at any moment", read the datasheet carefully to find out when you can safely change the values that are used to generate the waveforms. If the values are changed at the wrong time then the waveform can glitch, giving you a signal that does not have a 50% DC.