It should work but the square-wave won't be exactly at the zero crossing due to the forward voltage drop of the diode.
If you are concerned about eliminating the negative half of the waveform then couple the signal through a series resistor (≈10kΩ) and use a diode (cathode to ground) to clamp the voltage. Also connect the minus input to ground to detect the zero point.
It will also only work at low frequencies due to the low frequency response of the op amp. For higher frequencies you can use a comparator (such as an LM339) instead of an op amp.
What will the input signal voltage and frequency be in the real circuit?
Thanks for your reply.
I corrected as you told and circuit is working fine Now.
Its input will be 5Volt and 50 Hz. connected to output of CT, and PT. Its output will be connected to PIC Interrupt pins.
The output of a LM358 is a totem pole, when powered by 5v it will only swing to about 3.5 volts. Depending on the controller's logic thresholds, this will only provide a borderline logic high.
Use a LM393 instead. It has the exact same pinout as a LM358. Since it is an open collector output, you have to use an external resistor to 5v, and will swing accordingly.