Today I sort of got the 16F876 to do some A/D work, or at least what appears to be useful results. I put some LEDs on some of the port C pins (I only have 4 available so I chose bit 0, 2, 3, and 4) and I put a pot from +5 to 0 on analog channel 0 and the LEDs do change their pattern as I change the analog input, but there's some things I still don't know how to figure out about the program. The LEDs don't stay lit, they just flash quickly on and then stay off for a while and then flash on quickly again (with the same or updated data) and I can't decide if the program is somehow setup to do this purposely or if there is something I should know otherwise. I would have expected the ports to latch the samples so the LEDs are always on with the current sample data, not flashing with it, so I was wondering what might cause it. I thought I found some possible reasons for this in the original demo file I was using so I commented some things out but it still does the same thing. I first commented out a line that looks like it clears port C right after storing the sample data on the port so I thought, no wonder it is only flashing if it writes to the port and then clears it in the next line...but taking that out didn't help...then I wondered what is the use of the "WaitPush" loop that does something on port B....I thought maybe it wants port B to be doing something for it to latch port C....so I tried tieing all pins of port B high, then low, then some high and some low and all it did was change the rate of port C flashing data LEDs. So I commented out the whole loop and expected that the program would just sample the input, write it to the port, then immediately resample the input and update the port so that the lights would always be on with the data and would only change when the input level changed....but still all I get is flashing data, not latched output data. I appended the demo file here again with the commented out portions, hoping someone can look at it and tell me if it should be latched data or if there is a reason it's flashing, and if I should uncomment some of that stuff again to make it work better. All I ever wanted was a simple program to read the analog port and store the binary on the port so I can see that it changes the leds when I change the pot, but this flashing thing is making me wonder if I did something wrong. I ended up using just an RC combination on OSC1 still instead of a crystal if that is necessary information at all. And yeah, regarding that previous thread about the internal RC.....when I first tried this yesterday I had nothing on the OSC pins and the circuit didn't do anything so I didn't even have noise clocking it...now I have SOMETHING. ;DEMO file from MPlab files, modified slightly list p=16f876 include "p16f876.inc" org 0x000 nop Start banksel PORTC clrf PORTC ;Clear PORTC movlw B'11000001' ;RC, A/D enabled movwf ADCON0 banksel OPTION_REG movlw B'10000111' ;TMR0 prescaler, 1:256 movwf OPTION_REG clrf TRISC ;PORTC all outputs movlw B'00001110' ;Left justify,1 analog channel movwf ADCON1 ;VDD and VSS references banksel PORTC Main btfss INTCON,T0IF ;Wait for Timer0 to timeout goto Main bcf INTCON,T0IF bsf ADCON0,GO ;Start A/D conversion Wait btfss PIR1,ADIF ;Wait for conversion to complete goto Wait movf ADRESH,W ;Write A/D result to PORTC movwf PORTC ;clrf PORTC ;WaitPush ;btfss PORTB,0 ;goto WaitPush ;movwf PORTC goto Main end