My problem is that the code is not doing what I think it should be doing.

I have put LED blinkers at the beginnings of all subroutines. That way I can tell the path the code is taking. You understand, I have not been able to get MPLAB IDE to work at all. That is the tool with the debugging features. I am using PICkit 2 Programmer and my own ingenuity.

It looks like some arithmetic on the PULSIN results is not working correctly. I do not know how to read the VAR which stores the pulse size in units of 10 usec. I would like to see exactly what the PIC thinks it got, but that means reading RAM. I would like to put a break point in the code and read certain addresses at that point, but I have not been at all successful with that technique.

I planned, but did not get to it, to enter a Microchip FAQ forum to see what they all say about these two Microchip software products working together.

I'm tired. It is bed time. Thanks. Maybe things will be more clear in the morning.

Ken