Generating 40kHz square wave

Thanks for the replies, I'll give that a go