Electrical – How to change duty cycle in square wave

square

I'm using AD9833 to generate sine, triangle and square wave. Square from IC has 0,65V amptlitude and 50% duty cycle. I would like in simple way change duty cycle this square signal from 0-100%. Using potentiometer or uC. I have only one ideas, generate PWM from uC, but AD9833 is easier to control frequency.

edit
I designed this layout I want use 3 potentiometer to set duty cycle, ampltiude, and signal offset. You can check the correctness? In spice everything is okay.
V1 and V3 is AD9833 output

enter image description here

Best Answer

Is impossible to use triangular with comparator, because IC has one output for square and triangular. [From question comments.]

schematic

simulate this circuit – Schematic created using CircuitLab

Figure 1. A comparator will convert a triangle wave to a square wave while allowing pulse width modulation.

By adjusting R1 the switching threshold varies and this will adjust the pulse width.

enter image description here

Figure 2. Input and output when varying R1 from V3 to V2.

There may be some trouble at either end of the pot if the triangle peaks or troughs have any variation in amplitude. This would manifest itself at the low-end as a variation from low pulse-width to continuous 0 V and at the high end from high pulse-width to continuous 5 V.