FPGA counter value unstabillity
It looks like you are using SCL without ever synchronizing it to the clock. This is likely causing most of your strange behavior. Never use an external signal without first passing it through at least one register.