If you are referring to an ordinary UART serial port, I suppose you could configure it as 8-bit, no parity, one stop, and then transmit a continuous stream of 'U' characters. That would produce a square wave at frequency baudrate/2. The possible frequencies would depend on your serial port's available baud rates. Beware that your software must never allow the transmitter to become empty, or your clock will suffer gaps. This doesn't sound like a great idea.