Test program I made for the ICD protoboard: Reads the pot on RA0 and sends it out in PWM: Quentin Start banksel PORTC clrf PORTC ;Clear 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'00000111' MOVWF T2CON MOVLW B'00001100' MOVWF CCP1CON 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 CCPR1L BCF CCP1CON,4 BCF CCP1CON,5 BSF STATUS,RP0 MOVF ADRESL,W BCF STATUS,RP0 MOVWF TEMP1 BTFSC TEMP1,6 BSF CCP1CON,4 BTFSC TEMP1,7 BSF CCP1CON,5 goto Main ;Do it again end -- http://www.piclist.com hint: To leave the PICList mailto:piclist-unsubscribe-request@mitvma.mit.edu