Sine wave to square wave - Schmitt trigger
I would like to suggest that the comparator circuit shown by @hwengmgr could use some small improvements over what was posted. 

Improvements include:


Bigger capacitor value to reduce filter effect of the capacitor at frequency.
Larger value resistors in dividers to reduce current load on source supply.
Added hysteresis at the comparator to make the circuit less sensitive to noise that may be on the input waveform.
Changed pullup resistor on output of comparator to a more sane value for 1mA load instead of 33mA.






This was simulated with LT-Spice. I used a model for a comparator that was built into the package library. You can substitute a comparator of choice as long as it is specified for operation at a Vdd of 3.3V.

The addition of the hysteresis feature necessitated the swapping of the '+' and '-' inputs of the comparator which causes an inversion of the output waveform. If this is a problem it can be easily flipped with a logic element. If you select a dual comparator the other half of the package could be used to invert the signal.