PinCapture, strange results

I’m playing with the new PinCapture feature and seeing some strange results. I have an IR receiver set up on I/O7 and am trying to capture some signals from an IR remote. While I would suspect some variability in the times reported what I’m seeing looks like PinCapture is missing a variable number of state changes each time.

This is the heart of the test code:

            
            uint[] buffer = new uint[100];
            int count = 10;
            PinCapture pCapt = new PinCapture((Cpu.Pin)FEZ_Pin.Digital.Di7, Port.ResistorMode.Disabled);

            int total = 0;
            while (true)
            {
                Debug.Print("Ready");
                total = pCapt.Read(false, buffer, 0, count, 10000);
                if (total > 0) { Decode(total, buffer); }
                total = 0;
                Thread.Sleep(1000);
            }

Basically it just waits for up to 10 seconds to capture the number of state transitions determined by ‘count’ and then if the number seen was > 0 the ‘Decode’ method just prints out the buffer. A few samples of the first ten state transition times is below. (same button on remote pressed each time.)

Decode:10 bytes, rx#:0
1 30 HI
2 20 LOW
3 30 HI
4 20 LOW
5 40 HI
6 40 LOW
7 30 HI
8 20 LOW
9 40 HI
Ready

Decode:10 bytes, rx#:1
1 40 HI
2 41 LOW
3 30 HI
4 19 LOW
5 41 HI
6 19 LOW
7 30 HI
8 20 LOW
9 30 HI
Ready

Decode:10 bytes, rx#:2
1 30 HI
2 20 LOW
3 40 HI
4 30 LOW
5 20 HI
6 19 LOW
7 30 HI
8 20 LOW
9 30 HI
Ready

Decode:10 bytes, rx#:3
1 20 HI
2 19 LOW
3 30 HI
4 20 LOW
5 30 HI
6 19 LOW
7 41 HI
8 40 LOW
9 30 HI
Ready

Decode:10 bytes, rx#:4
1 30 HI
2 20 LOW
3 40 HI
4 20 LOW
5 30 HI
6 20 LOW
7 30 HI
8 20 LOW
9 40 HI
Ready

Decode:10 bytes, rx#:5
1 30 HI
2 20 LOW
3 30 HI
4 20 LOW
5 40 HI
6 40 LOW
7 30 HI
8 20 LOW
9 40 HI

You want to get more than 10 samples for sure, maybe 100, and then look in data to see the long delay between transitions. After that you can easily tell where is the beginning of frame.

these seem too low for an ir remote 20 and 30 microsenconds?

Also, we successfully decoded an IR remote signal. The values are in the 500 microsecond ranges…
You will hardly get the same values. Compare it between lower and upper limits for example:
if(time > 500 && time < 550) then it is a “1”…

What did you connect? Make sure your ‘IR receiver’ contains a baseband filter to filter out the flash-frequency.

What kind of IR receiver are you using?

Is it a normal IR sensitive photo diode? Or is it a 40Khz remote receiver?

If it is a normal photo diode then you will get all the transisions of the 40Khz carrier…

Edit: Bummer, why am I always so slow in typing my answer? :slight_smile:

OK, so I’m a moron. The IR signal I really want to decode has a carrier frequency of 48kHz. So I look at Vishay and find a wide band IR receiver and think, Great!, and order a handful of them. After looking at 3-4 other TV remotes on the scope it finally dawned on me that the signal I was seeing was still freaking modulated :’(

Reading the datasheet more carefully this time I see that these particular receivers were designed for IR repeaters and the like, sigh.

The 20~30 micro second times I was seeing is the carrier frequency…

As what I expected :slight_smile:

Hmm…nobody seems to make a receiver designed for a 48kHz carrier frequency. It seems 56 kHz is as close as it gets. I’ll order some to try them, but I wonder if I can demodulate the receivers I have now so I can optimize things for the strange carrier.

What about TSOP 48xx ? Unknown Domain

From my experience, here in Belgium most remotes can be captured with a 38kHz receiver like the TSOP 4838.

For your use, a TSOP 4840 will do the job (i guess, but it’s 20% out of range, so distance will be limited).

You can build your own active filter. (I’m pretty sure a passive filter won’t do the job). IR receivers are sensitive to sunlight, fluorescent light, plasma TV’s, etc. I don’t think it’s that easy to design a good filter.

The TSOP9838 receivers I have have a band pass filter in them so the output signal is clean, but still modulated. I found a 38kHz receiver locally at RadioShack and it works fine with a regular remote control but not with the ‘special’ device I’m trying to decode which has a 48kHz carrier. I’ll order the TSOP4840 and 4856 to see if by chance either one of them will work (doubtful).

I suppose that I could use a Cypress PSOC for the receiver, even one of the smaller parts would have enough programmable analog blocks to make a suitable filter.