square wave generation with 1055

Show off your simulator, discuss application specific issues.
fxpal
Phidgetsian
Posts: 7
Joined: Mon Jul 08, 2013 5:38 pm
Contact:

square wave generation with 1055

Postby fxpal » Mon Jul 08, 2013 5:48 pm

The API instruction is not clear to me for the following task.
1. How can I generate 2KHz square wave with 38KHz modulation signal using the 1055_0 - PhidgetIR hardware?
2. How can I use another 1055 board to detect the existence of this signal at a low bit rate (e.g. 100 bit/sec)?

Thanks,

Qiong

User avatar
Patrick
Lead Developer
Posts: 3003
Joined: Mon Jun 20, 2005 8:46 am
Location: Canada
Contact:

Re: square wave generation with 1055

Postby Patrick » Tue Jul 09, 2013 11:56 am

Why do you want to generate a square wave specifically? The 1055 isn't designed to send a continuous signal - though you could achieve this by sending raw data where every member is 500 us, including the gap, over and over again.

Generally, you would simply use the transmit function to transmit data, using a specified CodeInfo - any other 1055's in the area will pick up these transmitted messages. If you are just transmitting a 2 kHz signal, then the other 1055's will pick this up as raw data.

-Patrick

fxpal
Phidgetsian
Posts: 7
Joined: Mon Jul 08, 2013 5:38 pm
Contact:

Re: square wave generation with 1055

Postby fxpal » Tue Jul 09, 2013 2:35 pm

Thank you Patrick.
We are trying to broadcast info with this IR channel.
To avoid AGC switching (the gain control cannot be set via code), we plane to add a 2KHz square wave modulation to the base carrier signal. The 2KHz square wave modulated 38KHz carrier signal is our IR light source.

1. If I want to generate continuous signal, should I put Transmit(Byte[] data, IR_CodeInfo codeInfo) in a loop? Will the signal still be square wave between two Transmit calls? Besides the 500us gap, what should I set for other values such as encoding, trail, zero, one, repeat, toggle_mask? May I leave them empty or set them to zero? How can I set the carrier frequency to 38KHz or 56KHz?

2. On the detector side, I should use the ReadRaw function, right?
The "int ReadRaw(int[] data, int length)" read in int instead of Byte. How many bits do the int have? 8bits or more? Does one int correspond to one Byte in the Trasmit function?

3. What is the length limits of data for both Transmit and ReadRaw? I think that may depend on the memory size on the 1055 board. But I cannot find explanation of that.

4. Do you have sample code related to this?

Thanks,

Qiong

User avatar
Patrick
Lead Developer
Posts: 3003
Joined: Mon Jun 20, 2005 8:46 am
Location: Canada
Contact:

Re: square wave generation with 1055

Postby Patrick » Tue Jul 09, 2013 4:12 pm

I'm still confused about what you want to accomplish. What sort of hardware are you trying to transmit to? What kind of information do you want to transmit? The 1055 is designed for sending/receiving consumer-IR signals (like those used for TV's, etc.). It's not really meant for continuous transmission.

You will want to use transmitRaw. The max data length is 125 bits (63 ms of 2 kHz signal with the gap). If you call transmitRaw over and over in a busy-loop, then this should be reliable. So, you will create an array, 125 elements long, full of 500's, to use with transmitRaw(). Set the gap to 500, dataLength to 125. You can set duty cycle and carrier frequency to 0 to get the defaults of 33% and 38 kHz, or specify these explicitly.

readRaw / rawData event will just give you a continuous stream of 500 us data on the other end.

-Patrick

fxpal
Phidgetsian
Posts: 7
Joined: Mon Jul 08, 2013 5:38 pm
Contact:

Re: square wave generation with 1055

Postby fxpal » Tue Jul 09, 2013 8:05 pm

Does the 1055 IR receiver has automatic gain control?
For our experiment, it is better to have a fixed gain. The 2KHz signal we used for modulation is for avoiding gain control switching. If the sensor has fixed gain, we may skip the 2KHz signal.

Thanks,

Qiong

User avatar
Patrick
Lead Developer
Posts: 3003
Joined: Mon Jun 20, 2005 8:46 am
Location: Canada
Contact:

Re: square wave generation with 1055

Postby Patrick » Wed Jul 10, 2013 2:37 pm

Why is this something that you are concerned about? You may wish to consult the receiver module data sheet: http://www.vishay.com/docs/82489/tsop322.pdf

of particular interest:
After each burst of length 10 to 70 cycles a minimum gap time is required of ≥ 10 cycles.
For bursts greater than 70 cycles a minimum gap time in the data stream is needed of > 4 x burst length.
Maximum number of continuous short bursts/second: 1800.

So, while you can probably transmit a continuous 2 kHz signal - you may have trouble receiving it reliably by a 1055.

-Patrick


Return to “Simulators”

Who is online

Users browsing this forum: No registered users and 1 guest