We have a magnetic encoder that measures angle... We use PACNT counter to measure the pulse width. The values are between 0 and 20000. After each angle reading, we want to store the value of PACNT into an unsigned integer. But something is wrong... The value of the variable is just around 30 whereas PACNT is around 4900. We see 4900 in the memory but when we try to copy it into the variable (D register), we encounter this problem. Can you help me?