maria258
Member level 2
I have already saw my code working with an 8 bit adc but i just dont know how to make it 10 bit. here is apart of my code that i tried to do for a 10 bit. i added PORTC for the extra 2 bits, now i want PORTB for ADRESH and PORTC for ADRESL but dont know how to combine them in z.
thanks
maria
thanks
maria
Code:
TRISB=0x00; //output
TRISC=0x00; //output
TRISA=0xFF; //inputs
LEDS_8=0xFF; //clear/switch off LEDS
LEDS_2=0xFF; //clear/switch off LEDS
Code:
GODONE=1;
//wait end-of-conversion (conversion complete)
while(GODONE==1);
x=ADRESL; //store low byte
x=x; //shift 1 bit to the right
y=ADRESH; //store high byte
y=y<<8; //shift left 7 bit position
z=x|y; //combine together
LEDS=~z; //output on leds