Sorry for delay to upload the code.
Also I have upload tree screenshot of a digital oscilloscope to better explain what happens.
Channel B show the incomin IR signal and channel A should show with the pulse of SData/PORTB.1 the begin/end of PULSIN.
You can see some missing SData/PORTB.1 pulse on the uploaded images, but belive me the IR code is correctly recognized of the incaming IR pulse duration and the array IRpuls_len(x) contain the correct pulse lenght.
The uploaded program 16F877_IR_pulsin.zip works correctly, but leave me unsatisfied about the use of PULSIN.
I will expect one pulse of SData/PORTB.1 at the begin of PULSIN and another pulse of SData/PORTB.1 at the end of the PULSIN statement, yust before the execution of the next statement, and no SData/PORTB.1 missing as you can see per attached images.
Ciao
Leo




Bookmarks