Depends on what the pin is connected to. If it is not connected to any thing then you won't hear anything. If it is connected to a speaker or a piezo transducer then you will hear sound. The sound of a square wave is actually kind of harsh. The original PC had a speaker for clicks and beeps.

You could hear something if you use a coupling capacitor from the MCU pin to the "Line" input of your stereo system. The square wave is rich in harmonics, so even if you start with 20Hz, you will hear all the odd harmonics (60Hz, 100Hz, 140Hz, ...).

Yeah, and the 20kHz side of the spectrum goes down with the age...A middle aged man usually cannot hear anything above 14/15kHz.

Click to expand...

If he's lucky. I checked mine at age 42 and was hearing up to 8KHz in one ear and about 10kHz in the other. Ironically, the high pitched whine I hear all the time is at about 10kHz being "heard" in the ear that can no longer hear that high. Old age can be cruel.

People who experienced loud noise hearing damage from guns or a nearby rock band cannot hear high audio frequencies.

Click to expand...

Or worse yet: played drums in a band in high school and then rode a motorcycle for 30 years. It's amazing how the helmet wind noise from riding really does it. Don't know how loud it is but it must be pretty loud.