Can you make a small sketch for us that we can try ?
The code you showed does not tell if the variables are integers or bytes: http://snippets-r-us.com/.
The %X on a Arduino Uno is for a two-byte unsigned integer that will be showed in hexadecimal format as capitals. The sprintf will read two bytes for every %X.