i am using pic16f877,my project is temperature controller.i would like to use inbuilt adc of pic16f877, but the output of the adc is 10bit.
how can i convert the output data(10bit) of adc into equal value of 8 bit data and display result using 7-segment display.
adresh has 8bit
adresl has 8bit
how can i shift both registers
i have to right shift the both registers separately and tell with carry or without carry
can u give me code for this shiffting the registers
BCF STATUS, C ;Clear carry, it will be shifted into MSB of adressh
RRF ADRESH, F ;rotate adresH Right trough carry, carry holds previous LSB of adressH
RRF ADRESL, F ;rotate adresL right trough carry, LSB will be in carry
Do this twice and the entire value will be shifted right 2 bits
No need for that shift none sense. During initialization, make sure bit7 (ADFM) of ADCON1 register is "0". The 8-bit ADC result is read from ADRESH only (i.e. ADRESL values are ignored).