Convert 10 MHz ref generator to use a counter so it can be reset correctly and consistently produce the correct duty cycle
Add some hysteresis to prevent external reference from unlocking unnecessarily