How to make a PWM signal that changes frequency

Hi…
I am currently seeking for a simple method that creates a PWM signal, and changes the frequency such that it follows the positive slope of this figure.


The x-axis is there the time in seconds and y is the frequency in

I am currently creating the PWM signal by toggling a pin as such

 while(!(PINB & (1 << 2)))  
  {
      PORTB ^= _BV(PB3);  // Toggles the step_pin

  }

But cannot change the frequency of the pin… How do i make it follow the positive slope of the curve?

You might find this library helpful

Could not be done in this while loop? like calculating a delay and decrementing that?

kidi3:
I am currently seeking for a simple method that creates a PWM signal, and changes the frequency such that it follows the positive slope of this figure.

If you explain why you need to do this I think you will get more useful advice.

...R

You want to adjust both the frequency and the duty cycle (which appears to be 50% at the moment, if I read your code correctly ) ?
The graph does not appear to be linear between 0 and about 500 Hz. Is that intentional ?