Hi, mybe the problem is in startment of your program in the bit LVP. I got it too and I did __CONFIG _CP_OFF & _XT_OSC & _PWRTE_ON & _WDT_OFF & _LVP_OFF The default came with LVP_ON (Low voltage program). Tray to do it. Regards Anbar -----Mensagem original----- De: Lorick Para: PICLIST@MITVMA.MIT.EDU Data: Sexta-feira, 24 de Mar¨o de 2000 22:37 Assunto: PIC Looping when I don't have any loops? >I did a test program with the intent to take just one analog sample, >display it, and end the whole program, but the pic keeps updating the output >LEDs as I change the analog input even though I only set the program to just >do one a/d conversion with no looping. This isn't making sense to me and I >was wondering if anyone has an explanation. The only way I can see it >happening is if somehow the circuit is getting constantly turned off and on >(reset) and it really would be doing just one sample, but doing it as many >times as reset. But I don't buy that. > >Here is the code > > list p=16f876,R=DEC > include "p16f876.inc" > __CONFIG _CP_OFF & _XT_OSC & _PWRTE_ON & _WDT_OFF > > org 0x000 > > banksel PORTC > clrf PORTC > movlw B'01000001' ;Fosc/8, 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 > movlw B'11000001' ;A/D ch 0 enabled > movwf ADCON0 > > bsf ADCON0,GO ;Start A/D conversion >Wait > btfss PIR1,ADIF ;Wait for conversion to complete > goto Wait > > movf ADRESH,w > movwf PORTC > end