yeah sure chimera786
Suppose your adc converts an analog signal suppose 5V analog voltage to 1023
So 1023 in HexaDecimal is 3FF
if You Choose Right Justified then FF will be stored in ADRESL register
Means ADRESL = 0xFF;
and
ADRESH will contain 0x03
I generally follow this methodology as it is similar to real world
but if you choose left justified
the values in Register's are as follow:
ADRESH = 0x3F
ADRESL = 0xF0
which i personally feels not good for me.. but one can use this if they want
I like the Right Justified one...
And the logic to merge these into a single variable is also simple
Declare a variable as
unsigned int adc_data;
when conversion gets over use these statements
Code:
adc_data = ADRESH & 0x00FF; //Declare adc_data as unsigned int type
adc_data = adc_data<<8;
adc_data = adc_data | ADRESL;
//so if ADRESH contains 0x03
//and ADRESL contain 0xFF
//then adc_data contains
adc_data = 0x03FF;
Hope this helps you...