I would better understand how work PULSIN statement.

I'm using PULSIN of PICBASIC PRO rel 4.47 on a 16F877 at 20 Mhz for decode IR from remote, using Sony format.

In order to better understand, I would track the timing of PULSIN using one free output pin to view with a scope the beging/end of the PULSIN duration with the following statement:


for BitCount= 1 to 12
High SData: pauseus 1: low SData ' Before pulsin, generate a pulse wiewable with an oscilloscope.
pulsin IR_Sensor,0,IRpuls_len(BitCount)
High SData: pauseus 1: low SData ' Before pulsin, generate a pulse wiewable with an oscilloscope.

if IRpuls_len(BitCount) < 580 then
Packet.0[BitCount-1]=0
Else
Packet.0[BitCount-1]=1
endif
next BitCount

In my mind, I immagine that first there are an ON pulse as a witness of the PULSIN begin, then after 2,4 or 1,2 or 0,6 mS I should see the second ON pulse.

Running it, never I see the ON pulse in continuos phase, with begin/end of PULSIN, but in a random position. Take note that the "IRpuls_len(x)" contain the correct value of the pulse lenght, 2,4 mS, 1,2 mS and 0,6 mS.

Also working with DEFINE PULSIN_MAX with different value do not help to view the second pulse in timing with the end of PULSIN duration.

Any comment or consideration is welcome.

Ciao

Leo