int on Uno more than 16 bit?
I guess you're seeing some big numbers starting with FFFF...?

What you are seeing is not big numbers - it's misrepresented numbers.

You have an int. That's not a "16-bit number", it's a 15-bit number plus a sign bit.  

When you print it the variable is promoted to a long and the sign bit is extended.

That long is then further mapped (cast) into an unsigned long to print it as hexadeximal (there is no negative in the hexadecimal representation on Arduino), and that extended sign bit is seen as a string of F.

For example, the value 0xABCD stored in an int is:

 1 010 1011 1100 1101


I broke off the first bit because that is the sign bit in a signed integer.  The actual decimal value of that is -21555.

Now when that gets cast to a long the sign extension copies the leading sign bit to all the other 16 bits to the left of it, resulting in:

1 111 1111 1111 1111 1010 1011 1100 1101


Because of the way that twos complement works, that string of bits still represents -21555 in decimal.

However, cast it to unsigned long for printing as HEX and you can see how you would end up with some big numbers.  It would give you:

FFFFABCD


So you can see that a 16 bit signed value can end up being printed as 8 hex digits, and all because of the way the print() function in the Arduino API works.

When working with unsigned values you really should be working with an unsigned variable - especially if those unsigned values (0 - 65535) fall outside the range of the signed variable type (-32768 - 32767).  Switch to using uint16_t and you will be able to both store and represent the values correctly.



You might find it useful playing around with this site to learn how different variable types represent and store the data within them as binary.