The frequency must be a variable.
You can't pass a constant as the parameter.

And just shift left 2 (<<2) to use 8-bit values.

hth,