mehmet kopmaz

[MC9S12C128] Can't assign counter value to an unsigned integer correctly?!

Discussion created by mehmet kopmaz on Jul 21, 2009
Latest reply on Jul 25, 2009 by pgo



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?