- Joined
- Jan 22, 2008
- Messages
- 53,208
- Helped
- 14,794
- Reputation
- 29,875
- Reaction score
- 14,316
- Trophy points
- 1,393
- Location
- Bochum, Germany
- Activity points
- 301,470
I guess, you expect highbyte to be copied to the upper byte of full_value?
But according to C language rules it isn't. high_byte<<8 is still an int8 value. (int16)high_byte<<8 will do.
With CCS C, you'll possibly want to use the built-in make16() function for this purpose, or even more comfortable, use the respective ADC functions.
Code:
full_value = ((high_byte<<8)|low_byte);
With CCS C, you'll possibly want to use the built-in make16() function for this purpose, or even more comfortable, use the respective ADC functions.