Inverted values - digital resolution issue?
This looks like a "signed number" problem.

An unsigned binary number with n bits has a range from 0 to 2^n -1

But a Signed number weights the MSB as -2^(n-1) so the range is -2^(n-1) to 2^(n-1) -1



Consider an unsigned signal going from 0 to 255 being viewed as though it was a 2's complement number. Notice how it would look as though it flips from +127 to -128 and continue up to -1 (255 corresponds to -1).

Is that what you're seeing?

I notice that you're max digital value is 65536. But the maximum value a 16 bit unsigned number can hold is 65535 .. 2^16 -1