Skip to main content
Topic: IR TOY2 does IRscope2 (IR Widget) (Read 47894 times) previous topic - next topic

Re: IR TOY2 does IRscope2 (IR Widget)

Reply #60
[quote author="domi"]I am coming back with some results.



Here the value of the 25 first bytes received.
[attachment=0]

And finally, this last picture shows the full 5600 samples,  of which picture 3 represents the beginning of in more detail.
[attachment=1]

Is the Widget mode totally erroneous, of do I miss the basics thereof?
Maybe I have to compare with the firmware USBIRToy_irW.hex . Unfortunately I did not found that firmware yet.[/quote]

I wouldn't say that it is totally erroneous, but you seem to be repeatedly ignore what I've been telling you about widget mode.  I'll say it again.  The standalone widget FW for the IRToy works perfectly.  The all in one FW that includes all of the modes, does not work properly in widget mode.  I'll try to describe again how the widget mode is supposed to work.

Once the port is opened to the widget, nothing will be sent immediately.  The widget waits until it detects an IR pulse from the detector.  As soon as that happens, it opens a 100 us gate time during which it counts the number of pulses received.  At the conclusion of the 100us, it sends the count of pulses detected, to the host computer as a single byte value.  Immediately following the first 100us gate interval, the widget begins counting the number of pulses detected in the following 100us interval.  The part that I forgot to tell you previously, is that it doesn't start the count over at 0, it simply continues counting from the value it had at the end of the previous 100 us period.  That is why you see an increasing value being sent in successive bytes when there are IR pulses present in a given 100 us period.  From your list of values received, you can see that during the first 100us period, there were 3 pulses detected.  Then in the next 100us period, there were 4 additional pulses detected (07 - 03).  Then the next 100us period, there were 4 more pulses detected (0b - 07) and on and on.  Eventually at entry 9, you see that the byte value being sent, stops increasing.  That is, it keeps sending the same value over and over.  This is because starting at entry number 10 thru entry 17, no IR pulses were detected.  That is, there is a gap of 800us during which there were no pulses.  Then starting at entry 18, the pulse count starts increasing again meaning that pulses are again being detected.

So, very roughly, you have a total of 31 pulses detected for the first 900 us of time, followed by 800 us of no pulses, followed by 31 pulses detected during the next 800 us.  This is very rough.  There are more subtleties here, but this is the most basic analysis.  All is for naught though, since a real widget or an IRToy running the standalone widget FW both continuously send the pulse count FOREVER as long as the host computer keeps the port open.  As you've seen and I already saw in my own tests, the IRToy FW that includes all modes, does not keep sending continuously, but rather stops for no obvious reason aside from a FW bug.

Conclusion: Widget mode in the IRToy FW including all modes, is not functional in any useful way.  If you must have widget mode working, you must use the standalone widget FW for the IRToy.  There, it works perfectly.  Unless you just want to rediscover gravity, there isn't any reason not to use the existing IRScope software.  It is very well developed and refined, though not perfect.  It has extensive capabilities to analyze the protocol via the JP1 community's IRdecode.dll software.  If you really want to re-invent the wheel, by all means go ahead and develop your own software to do all of this.

Re: IR TOY2 does IRscope2 (IR Widget)

Reply #61
Any idea where I can find the Widget FW?

Re: IR TOY2 does IRscope2 (IR Widget)

Reply #62
[quote author="domi"]Any idea where I can find the Widget FW?[/quote]

A few pages back in this very thread:

viewtopic.php?f=29&t=2554&start=30#p48238

Re: IR TOY2 does IRscope2 (IR Widget)

Reply #63
I found in irWidget.c the reason why this mode gave erroneous output
viewtopic.php?f=29&t=2554&start=45#p53025 and viewtopic.php?f=29&t=2554&start=45#p53026

                if (SendCDC_In_ArmNext(irW.RXsamples))
                irW.RXsamples = 0;

should be replaced by

                SendCDC_In_ArmNext(irW.RXsamples);
                irW.RXsamples = 0;

There are also other minor details which could improve efficiency and functionality, as e.g.

            if (((irW.RXsamples == CDC_BUFFER_SIZE))) {
instead of
            if (((irW.RXsamples >= 30))) {

But more on these details later.