l4a added. generates square wave of desired frequency