I am using the PIC18F4320. I am writing in C-language and using MPLAB C18 tool suite(compiler V2.2). I have a question about the ADC result registers (ADRESL and ADRESH). I must use all 10 bits; therefore, I have to do the simple task of taking the two 8-bit result registers and combining them into a 16-bit integer. The following code is how I did it: (obviously before this I set the ADC result to be right justified and VBattNew is defined as an unsigned int) (I also send the raw values out the USART before the statements below - getting exactly what one would expect in each of the bytes) //Sent data out USART here VBattNew =3D ADRESL; // Get low byte //Sent data out USART here VBattNew |=3D (ADRESH << 8); // Combine with the high byte into 16 int //Sent data out USART here The problem is the high byte continually gets cleared to 0x00 - I cannot get past 255 decimal. I even sent the raw data out the USART before, between and after for inspection, and it is clear the left shift and integer assignment is clearing the high byte? I tried the code below to make sure I was not trying to do much at once with the above syntax - same problem: // VBattNew =3D ADRESL; // Get low byte // temp =3D ADRESH; // temp << 8; // VBattNew =3D temp | VBattNew; The final fix which works is using the ADRES definition in the p18f4320.h file - which apparently is the entire 16-bit concatenation of the two bytes; as follows: VBattNew =3D ADRES; // This works But, I want to understand why my code did not work - I bet it is surprisingly simple (as always - its one bit screwing things up). By the way I did search the archives and found someone posted code the same way I did it - should be a slam dunk. Thanks for your time guys, Shawn -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist