Generate square wave on pin 9