//_____________________________________________________________________ADRES is not a valid resister.
adval has been declared as an unsigned integer, i.e. 16 bits.
ADRESH is an 8-bit register, containing the upper bits of the ADC result.
Setting
adval = ADRESH;
first guarantees that the 8-bit result gets stored into a 16-bit variable.
Then
adval = (adval << 8);
will shift the result to the left by 8 (the same as multiplying by 256).
Now you can add (or OR) the lower 8-bit value ADRESL.
adval = adval | ADRESL;
Hi .
Can you explain the following command to me completely ?
How it run step by step ?
16_bit_variable = ((ADRESH << 8 ) +ADRESL);