The normal charge path is R1(1K) → R2(5K) → C1(1n), and discharge path is C1(1n) → R2(5K), the R2(5K) is the common path and all the same value whatever during charge or discharge.hello,
i have done it is working what is theory behind it
When it change to pwm that it just used two diodes to separated the R2 to two parts, the charge time and discharge time is different.
The charge time :
R1(1K) → D1 (left one, up is(+), down is (-)) → left side of R2(5K) → C1(1n)
The discharge time :
C1(1n) → D2 (right one, up is(-), down is (+)) → right side of R2(5K)
When you adjust R2 then The charge time and The discharge time will be different, that's how it became a pwm circuit.
Please read the page 143, 144 carefully in the links of your first post, it has comparator and it can be a D/A converter, so you can using it to generate the wave you want.and how to build sawtoth wave and triangular waveform..
If you do not satisfy the D/A resolution of above method then you can add a 8 bits dac as dac0800, and output 8 bits data from I/O port to dca0800 to generate the wave you want.
For further improvement then you can add a op amp and capacitor to make the waveform more smooth.