Reading and generating square waves at the same time.

Is the jitter caused on the input side or the output side? If it's an input problem, obviously you'd be wasting your time trying to improve the output mechanism.