The Netduino forums have been replaced by new forums at community.wildernesslabs.co.
This site has been preserved for archival purposes only
and the ability to make new accounts or posts has been turned off.
I have got some help from AnalysIR team and it seems like it's not possible to communicate via Serial with USB infrared toy:
If my memory is correct, the serial pins allow you to use the toy as a serial bridge. So when you enter serial bridge mode, it acts like a serial to USB adapter only.
It only does the IR sampling via USB. So you would have to re-write the firmware to achieve what you want.
So, the idea of using "USB Infrared Toy 2" bites the dust. Will be using it with USB on the PC only.
Before I got Netduino, I successfully played with USB Infrared Toy from Dangerous Prototypes. I managed to send/receive IR from C# based application via USB.
So, now I am wondering if it will be possible to connect it to Netduino 3 and control it from the board.
Do any of the books describe how to connect devices? Also, how do I know that the boards designed for Arduino (or any board like this USB Infrared Toy) are compatible with Netduino?
Looking at the product page for the USB Infrared Toy really quickly...
Do the UART pins on the Toy carry the same data as the USB transport? If so...
What signal voltage do the UART serial pins use? If they're 3.3V (or 5V with 3.3V signal recognition) then there's a good chance that you can reuse some/all of your desktop C# code on your Netduino 3, using SerialPort. Just wire up UART TX/RX between the Netduino 3 and the Toy (crossing RX/TX of course)--and connect GND between the two boards so they share a common electrical return path (GND).
Everything runs at 5volts, so power is taken directly from the USB port without regulation. A single power supply pin gets a 0.1uF decoupling capacitor (C1). The USB features require a 20MHz external oscillator (Q1, C5, C6).
The chip is initially programmed thorough a 5pin ICSP header. A 10K pull-up resistor (R1) and a diode (D1) on the MCLR pin protect the rest of the circuit from the 13volt signal used during programming.
An indicator LED (I) with 2K current limiting resistor (R2) displays power, USB, and infrared mode status.
The USB transceiver has an internal 3.3volt regulator that requires a 220nF (0.22uF) external capacitor (C2).
So, it seems like it's worth trying to connect them, like you described.
Just wire up UART TX/RX between the Netduino 3 and the Toy (crossing RX/TX of course)--and connect GND between the two boards so they share a common electrical return path (GND).
Chris
However I got lost here.
3 connections on Toy:
UART.RX
UART.TX
ICSP.GND
should be connected to ones on Netduino:
??
??
Power.GND (there are 2 of them, does it matter to which one?)
All three GND pins are connected to the shared GND plane...so all of them will work equally. Electricity always flows "toward ground" in the end, so for two devices to communicate they typically need a common GND plane.
Toy.ICSP.GND > Netduino.DIGITAL.GND (or any ground)
one last thing before I connect it is the "crossing RX/TX of course" . Does it mean that Toy.RX should go into DIGITAL.1 and Toy.TX into DIGITAL.0? or did I get the meaning of "crossing" wrong?
As you surmised, the UART TX on the Toy needs to go to UART RX on the Netduino (and vice-versa). That was the Netduino is getting the signals sent by the Toy and the Toy is getting the signals sent by the Netduino.
So...swap your pin D0/D1 connections and you should be good to go as far as logic wiring is concerned.
As far as I understand, it does not need extra power supply, is this correct?
So, now this device is both input and output.
Probably, for a start, the most straitforward would be to get the status that the device is "listening"
Then try to send a signal from a remote control and see if it triggers an event and gets some data.
Since I will be sending the signal to the device, I should probably create an InputPort and AnalogInput but I am not sure about glitchFilter flag and ResisorMode.
First step: you need to supply power to your device How are you powering your device?
You currently have the signals set up (like connecting a serial cable from your computer to a device) but you need power too. Signals are just a communication pathway; as a general rule signals won't power chips.
You can use the 5V and 3V3 (3.3V) headers on the Netduino to power your device, if it accepts external power. Orperhaps power the device via its own USB connection?
I've got the power now I connected 5v from Netduino. I will try the exteranl USB some time later. (By the way, could it be so that when I connect the USB to the Toy, it will "think" that I will be using the USB for the data connection as well and disable the data pins?)
so, the light is on and hopefully I am ready to program the communication:
My hopes for making [USB] Infrared Toy work are fading away. I went into testing communication between the Toy and PC and make sure that it can get the basic commands go through, such as getting the version from the Toy. It worked while connecting via USB but Serial via my USB-To-Serial adapter does not go through.
I have posted a question on the DangerousPrototypes forum and hope that someone might give me a hind if I am doing something wrong. http://dangerousprot...php?f=29&t=7214
it's strange that I could see that some data gets into the terminal via Serial, but if I compare USB via Serial again, the USB delivers proper data, and Serial data is just a bunch of garbage {Null}, {F0} and {F8} bytes.
I have got some help from AnalysIR team and it seems like it's not possible to communicate via Serial with USB infrared toy:
If my memory is correct, the serial pins allow you to use the toy as a serial bridge. So when you enter serial bridge mode, it acts like a serial to USB adapter only.
It only does the IR sampling via USB. So you would have to re-write the firmware to achieve what you want.
So, the idea of using "USB Infrared Toy 2" bites the dust. Will be using it with USB on the PC only.