Solution
Your program is fine. Paralle mode is default with hysteresis.
Hysteresis can reduce measurement noise.
If you disable the hysteresis, the value will be wrong. Banked mode is not supporting for hysteresis. Please find another good source to generate square wave.