The attached code (Sig gen 2) uses PWM output of an 8M2 to generate a square wave at 61Hz to 4MHz. Frequency output is altered by 2 momentary push buttons, Up and Down. There are 2 possible sets of frequency outputs - multiples of 1 ,2, 5 or multiples of 1, 1.25, 1.52, 2, 5, 3, 4, 5, 6, 8...