Pd_external that generates a square wave