Tidied up some functions in the timer init

created an interupt based squarewave generator as a template for
arbitrary function generation