PWM desired frequency PROBLEM!!!!

int main(void)
{
    DDRD |= (1 << DDD6);
    // PD6 is now an output

    OCR0A = 128;
    // set PWM for 50% duty cycle


    TCCR0A |= (1 << COM0A1);
    // set none-inverting mode

    TCCR0A |= (1 << WGM01) | (1 << WGM00);
    // set fast PWM Mode

    TCCR0B |= (1 << CS01);
    // set prescaler to 8 and starts PWM


    while (1);
    {
        // we have a working Fast PWM
    }
}

how to varry frequency in this code

Quick question "how to vary frequency"? Quick answer: Use a different pre-scaler value.

Refer to Arduino Playground - TimerPWMCheatsheet for additional Information.