"Olin Lathrop" writes: > Paul Chany wrote: >> The circuit can be seen here: >> http://csanyi-pal.info/album/index.php/album/section/2#1 > > Not really. Details too small. Then You can see it with original size here: http://csanyi-pal.info/album/index.php/image/view/4 The changed assembly program is bellow. ---------> LIST P=16F877A #INCLUDE "P16F877A.INC" __CONFIG _XT_OSC&_CP_OFF&_WDT_OFF&_LVP_OFF ORG 0 START ;switching to BANK1: 00 BCF STATUS,RP1 ;Bit Clear file, RP1=0 BSF STATUS,RP0 ;Bit Set file, RP0=1 MOVLW 0x06 ;6 to Work register MOVWF ADCON1 ;PORTA digital MOVLW B'00011111' MOVWF TRISA ;PORTA as input MOVLW B'00000000' MOVWF TRISD ;PORTD as output BCF STATUS,RP0 ;switching to BANK0: 00 MOVLW B'00000000' ;switch off the LEDs MOVWF PORTD MAIN BTFSC PORTA,2 ;skip the next command if the ;Optical Slotted Switch connected to RA2 pin ;(PORTA) with Collector of the PhotoTransistor ;give to us logical 0, because there isn't ;anything in the slot BSF PORTD,1 ;switch on the 1. LED of PORTD BSF PORTD,0 ;switch on the 0. LED of PORTD GOTO MAIN END ---------< >> I can't se any changes on LED's here when I put a paper in the slot >> of the optical swith. > > Paper is not likely opaque enough. Try aluminum foil. I try with cardboard (pasteboard). No changes seen. Actually, I can see the 0. (PORTD,0) and 1. (PORTD,1) LED's to light permanently. -- Regards, Paul Chany http://csanyi-pal.info -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist