Hello Dear Neyolight
As i understood , you want convert your sinusoidal to an square wave .
You have some ways :
1- Clipping the sine wave with zener diodes .
2- With a simple comparator such as LM311 or LM339 or LM319 or ... etc .
3- With a transitor amplifier ( as you mentioned at first ).
So for your way , you should play with operating point of your amplifier .
you can do it at class A or at class B .
At class A , your input should be higher than the maximum input signal that is acceptable for your amp ( but it is possible due to the improper design , transistor go to the nonlinear region and destroy all thing !( your waveform )
So i suggest you , do it with a single stage class B amp ( if you want simultaneous square wave you should ad another transistor.
Best Things
Goldsmith
At first , my mean by single stage class B amp , was , this : if you don't need simultaneous amplitude wave ( minus and plus ) , you can do it with a class B amp , but if it is important to you , you can add another transistor to obtain simultaneous wave .
And about your circuit , you didn't tell , that where's the out and how much is your VCC and where is the base bias network ?!
Good luck
Goldsmith
Here's a snippet from an (arbitrary - the PIC16F88 in this case) PIC data sheet [they're all much the same] indicating what constitutes a logic "high" and a "low":
As you can see, any input voltage < ~0.8V will be regarded as a low, and > ~2V will be considered as high. Your waveform is perfect
Don't bother trying to change the duty cycle (without seeing your schematic I'm guessing, but I imagine it'll be a function of your signal input amplitude anyway) as it wont affect your measurements if you trigger/reset a counter on only the rising (or falling) edges. Depending on the PIC you're using, you can either use the timer/capture mechanism to measure the interval between edges or write a nice (lean) interrupt service routine to take snapshots of a free-running counter every time your (edge triggered) interrupt requirements are met.
Dear Neyolight
As i saw , your waveform , the rising edge and falling edge isn't good .
Anyway if you want to make it at logic level , according to the it's amplitude , it considered high . and you can give it to a simple not gate , to improve it's shape .
Regards
Goldsmith