How to know the Microcontroller to enter into Hold mode after Integration mode is done, and then controller don't know when the integration is done (because input square pulse may start at any time, so how to synchronize the input signal with Integrator Modes through program).