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

IR TOY2 does IRscope2 (IR Widget)

[attachment=0]


As you can see I have a working "IR widget" mode going with the IR TOY 2. This uses the QSE159 raw IR detector so it is only for the IR TOY 2.  The other IR widget mode "remote control" uses the IR demodulator (TSOP34838) found on both the IR TOY 1&2 however I am not sure if I will persist with adding this mode. I am open to feedback on this issue. Have your say and quickly too as I really have to move on with this.

The software app for the IR widget mode is called IRScope V2 and is available from here: http://http://www.hifi-remote.com/forums/viewtopic.php?t=11668

The IR scope software knows nothing about the IR TOY and as such the IR scope mode needs to be hard coded into the IR TOY source code. By this I mean that we cannot have it available as a menu option, it has to be ready to go when the IR scope App is run (like the sump mode and IR decoder mode currently are.) This is just not possible as there are conflicts between these modes.

For now the IRScope mode will be a separate compile. Later we may be able to store the mode in data EEPROM. Ian was talking about this idea for the IR MAN decoder mode. Maybe I could be piggy-back on top of this.

Anyway, attached is the hex file for the IR TOY 2 - IRScope (only). Please keep in mind that this is a beta and may have bugs. If you find anything please report it here.

Any other feedback will be welcome too.

Thanks...

Re: IR TOY2 does IRscope2 (IR Widget)

Reply #1
Hi JTR,

Nice demo, we'll post it up on the blog too.

This feature would be a huge evolution for the IR Toy. It's always great to work with existing
open source software.

Yes, we can store the startup mode in EEPROM like we do for the multiple-protocol decoder.

I've been running your last update in my home theater PC for weeks straight without a hitch :) Nice work.
Got a question? Please ask in the forum for the fastest answers.

Re: IR TOY2 does IRscope2 (IR Widget)

Reply #2
38 downloads and no reports? I love this, I can't wait to get it into the main release. I'm so glad someone did something with the new sensor.

It's also backed by the open source stack, and seems super stable.
Got a question? Please ask in the forum for the fastest answers.

Re: IR TOY2 does IRscope2 (IR Widget)

Reply #3
There is an IR Scope and IR Widget User's Guide on the Hifi Remote (JP1) Wiki that will be useful to those trying IRScope for the first time.

It would be nice to see the USB IR Toy be fairly plug and play with IRScope.  Currently IRScope never sends anything out the serial port to the IR Widget.  Instead it uses raising and lowering of DTR or RTS to reset and signal what mode to use. 

I've looked through the IRScope source code.  It looks like it wouldn't be too hard to add support for additional hardware.  There are maybe 3 or 4 places in the code that would need to change.  Unfortunately you need the MS VC++ compiler to compile it since it uses MFC.  I don't have a license for it and the freely downloadable express compilers exclude MFC.

Note: Somewhat understandably, the people behind irscope/irwidget strongly request that support not be added for devices that use IR demodulators only like the original IR Toy V1 because the IR demodulators do not give accurate representations of the IR signal.  The IR Widget and IR Toy V2 can do IR pulse counting which gives a more accurate representation of the signal which is more important if you are trying to learn the signals for sending via learning remotes.

Hope This Helps,
--Rob

Re: IR TOY2 does IRscope2 (IR Widget)

Reply #4
Good work! It took me a while of staring at it to understand the numeric annotations, but I do now.
The numbers in the pulses are the pulse counts for the carrier, and the number at the beginning of each transition is the microsecond duration for that section. What confused me was that it is off from what I expected, and measured with a real scope. I assume it's some sort of undersampling error. At what frequency is it sampling?

Re: IR TOY2 does IRscope2 (IR Widget)

Reply #5
Is this what you are thinking?
 If IRScope never sends anything to the IR Widget
1. Some other program sends code to set into IR Widget mode. Mode stored in eeprom as default for power cycles
2. If you want to change it back, the IR widget mode could listen for a specific code being sent to it, and switch the default mode back?

Re: IR TOY2 does IRscope2 (IR Widget)

Reply #6
[quote author="osbock"]What confused me was that it is off from what I expected, and measured with a real scope. I assume it's some sort of undersampling error. At what frequency is it sampling?[/quote]

The IR Widget protocol sends the number of IR pulses it saw during a 100 us window.  The intent of the IR Widget (and IR Scope) counting IR pulses rather than durations is to avoid the errors that occur with IR demodulators determining when an on period has ended.  IR demodulators can add 50-75 us to the on period while waiting 'long enough' (the absence of pulses) to drop the output.

What device did you have connected to the scope to see the IR?  If it was an IR demodulator you saw the error even if you were using a 'real scope'.  If you don't have an IR detector, try using an IR LED as a photo-voltaic device.  The sending remote needs to be as close as you can get it to the IR LED.  With a remote that didn't have any plastic window, I was able to observe pulses of nearly 1 volt with just the oscilloscope and an IR LED.  Note: the red window on some remotes can block too much of the signal to generate enough voltage in the LEDs.

Re: IR TOY2 does IRscope2 (IR Widget)

Reply #7
[quote author="osbock"]Is this what you are thinking?
 If IRScope never sends anything to the IR Widget
1. Some other program sends code to set into IR Widget mode. Mode stored in eeprom as default for power cycles
2. If you want to change it back, the IR widget mode could listen for a specific code being sent to it, and switch the default mode back?[/quote]

For the IR Toy to work with IRscope and any other software that uses the IRWidget without modifications, yes, I think that is the only way. 

On the other hand, the current IRwidget protocol/handshaking, using DTR/RTS, etc. is very limiting, so it might be better in the long run to see if the current maintainer of IRScope, (mathdon on the hifi-remote forum) will accept changes for supporting the iR toy that put it into the right mode and start capture by sending characters instead of using signal lines.

Re: IR TOY2 does IRscope2 (IR Widget)

Reply #8
Cool. Actually the times I was measuring was on my own device, and I hooked the scope up to one leg of the diode.
I wrote some code for the TV-B-Gone to trigger a nikon camera a while ago, and that worked fine (first time!) I decided to implement canon blind (don't have a canon dslr) and wanted to check the timing. Thank you for the explanation, it was very helpful!
To play with, I bought both the demodulator and the detector that USBIRtoy uses.

Re: IR TOY2 does IRscope2 (IR Widget)

Reply #9
Hello,
I downloaded USBIRToy-irW.hex to use the IR Toy with IRScope, and everything worked fine.
see viewtopic.php?f=29&t=4838&p=47175#p47175
Thanks to JTR for his good job

Re: IR TOY2 does IRscope2 (IR Widget)

Reply #10
[quote author="coste"]Hello,
I downloaded USBIRToy-irW.hex to use the IR Toy with IRScope, and everything worked fine.
see viewtopic.php?f=29&t=4838&p=47175#p47175
Thanks to JTR for his good job[/quote]

Does the bootloader need to exist on the PIC before this firmware can be loaded or does this hex file include the required bootloader + the IRWidget firmware?

I am assuming that this IRWidget firmware

0. Uses the Microchip USB stack driver?
1. handles the RTS and DTR lines correctly as expected by IRScope?
Looking forward to meeting other hobbyists. PM me if you are in or around Orange, CA!

Re: IR TOY2 does IRscope2 (IR Widget)

Reply #11
Has anyone being able to activate the bootloader via bootloader.exe after flashing with the IR Widget firmware?

The firmware is great, but you lose the ability to flash back the IR Toy unless you short PGC/PGD.

Re: IR TOY2 does IRscope2 (IR Widget)

Reply #12
In my (very slight) experience:
- when I received my IR Toy : bootloader.exe was able to activate the bootloader
- after flahing USBIRToy.v22.hex : bootloader.exe was still able to activate the bootloader
- after flahing USBIRToy_irW.hex : bootloader.exe was no longer able to activate the bootloader, I had to short PGC/PGD

So the commutation between IRScope mode and other modes is possible, although somewhat laborious...

Re: IR TOY2 does IRscope2 (IR Widget)

Reply #13
I'm hoping for a fix, or better yet, to include this functionality as another mode of the IR Toy.

Isn't the infrared frequency measurement the key feature of the IR Toy v2?

I bought it with the idea of using it to identify IR protocols, and I'm glad that even if a bit awkward it is still possible to use it this way.

In the meantime, found this script (I know bleh Perl), which could be coded in another language  ...

IR Toy .bin to IRScope .ict converter script
http://http://dangerousprototypes.com/forum/viewtopic.php?t=1482

Re: IR TOY2 does IRscope2 (IR Widget)

Reply #14
Pio
I tried this script on the test.bin file produced by the IR Toy in IR sampling mode (via the command "irtoy.exe -d COM9 -r -f test", after sending 0x00 'S' to put it in IR sampling).
The script works correctly (at least I suppose) and creates a test.ict file.
But decoding this file with IRScope (via DecodeIR.dll) does not give reliable results.
For instance, with a remote using NEC1 protocol, IRScope said "protocol NECx" (meaning "can't determine if NEC1,NEC2,NECx1 or NECx2"). The device number was correctly found, but generally not the OBC numbers.
I suppose the problem is that, in IR sampling mode, the IR Toy uses the IR demodulator, which doesn't report accurately the "on" periods. So, for the time being, I think the good way to decode IR signals with the IR Toy is to flash USBIRToy_irW.hex.