I'm having a hell of a time getting the ADC working on the PIC16F88. I'm currently trying the following... =20 A 5V switch (toggle on/off switch) hooked up to AN0 (Pin 17) LEDs hooked up to RB0-7 =20 I know Port B is working, because if I loop through numbers and output it to port B, it displays correctly. With ANSEL=3D0, if I just do PORTB=3DPORTA, I can toggle the switch and RB0 turns on and off appropriately. So, it's getting proper digital input for PORTA, and can output to PORTB properly. Getting analog to work seems to be my problem. =20 So, this is my source... I have overkill wait periods because I haven't calculated out a proper WaitUS function yet, so it's just "long" for now, where long is some period over 20 microseconds (T_ACQ). I've tried it both with and without the waits, in lots of different places. It doesn't do anything... So, I'm rather baffled. The ADC samples on the piclist page are all for other chips and have other parameters, so it's all very weird and there's not really much to work with here. I'm sure I'm just missing something/doing something stupid. =20 Also, if I do ANSEL =3D 1, that doesn't work either. So, for now I'm = just trying to have it ADC a digital value of 5V, which the user guide says it should be able to do... =20 void main() { ANSEL =3D 0; TRISA =3D 0xFF; //Port A all inputs TRISB =3D 0x00; //Port B all outputs PORTB =3D 0; =20 WaitUS(10000); ADCON1 =3D 0; WaitUS(10000); ADCON0 =3D 1; WaitUS(10000); =20 while (1) { WaitUS(10000); ADCON0 =3D 4; =20 WaitUS(10000); while (ADCON0 & 4) { } =20 WaitUS(10000); PORTB =3D ADRESH; =20 WaitUS(10000); } } =20 =20 -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist