Re: Change Transmit Carrier Frequency

USB infrared remote control receiver/transmitter. Get one for $20, including worldwide shipping.

Change Transmit Carrier Frequency

Postby Odje » Sat Mar 27, 2010 7:14 am

What command is required to be sent to change to 38.4kHz carrier frequency when in IRIO mode?

Don't quite understand the Pic timer calculator, need pre/post scaler values.
Odje
Newbie
Newbie
 
Posts: 12
Joined: Sat Mar 27, 2010 7:08 am

Re: Change Transmit Carrier Frequency

Postby ian » Mon Mar 29, 2010 5:10 am

Hi Odje,

It looks like the documentation on that part is a little thin. I'm updating it now.

The best tool I've found is this on line PWM calculator, that's how I found the original values. Enter the frequency and it calculates the values:
http://www.micro-examples.com/public/mi ... calculator

The clock is 48Mhz, duty cycle is always 50% (by bit shift right), it looks like the prescaler is fixed x4, but we can always make it configurable with the second don't care byte. Here is where the incoming byte is processed:
http://code.google.com/p/dangerous-prot ... IRIO.c#207

For your value, I used the online calculator and it had the best frequency at 4x prescaler anyways:
PWM TIMER2 Prescaler REGISTERS Frequency (Herz) Resolution (Bits) PR2 T2CON CCPR1L CCP1CON
36585.37 10 ÷4 0b01010001 0b00000101 0b00101000 0b00111100
37037.04 10 ÷4 0b01010000 0b00000101 0b00101000 0b00011100
37500.00 10 ÷16 0b00010011 0b00000111 0b00001001 0b00111100
37500.00 10 ÷4 0b01001111 0b00000101 0b00100111 0b00111100
37974.68 10 ÷4 0b01001110 0b00000101 0b00100111 0b00011100
38461.54 10 ÷4 0b01001101 0b00000101 0b00100110 0b00111100
38961.04 10 ÷4 0b01001100 0b00000101 0b00100110 0b00011100
39473.68 10 ÷16 0b00010010 0b00000111 0b00001001 0b00011100
39473.68 10 ÷4 0b01001011 0b00000101 0b00100101 0b00111100
40000.00 10 ÷4 0b01001010 0b00000101 0b00100101 0b00011100


So the value to send is PR2, that's 0b01001101, or 77 (0x4D).

The complete command is:
Code: Select all
0x02 0x4d 0x00

0x02 is the setup TX command
0x4d is the value from the table
0x00 is a don't care byte (doesn't matter)
Got a question? Please ask in the forum for the fastest answers.
User avatar
ian
Crew
Crew
 
Posts: 10803
Joined: Mon Jul 06, 2009 6:14 am

Re: Change Transmit Carrier Frequency

Postby Odje » Tue Mar 30, 2010 4:10 am

Thanks Ian. Very informative.

I can't seem to get any of my AV equipment to respond to USB IR Toy. I am using IRIO mode to capture the IR signal from the IR remote. Then trying to retransmit it from the IR Toy to the AV equipment. I have set the IR toy to 8 bit mode to match the incoming signal. The yellow LED to lights to indicate reception and transmission. I have tried it with my TV, Logitech Z5500 speakers and my Yamaha Amp.

I wondering if the carrier frequency does not match or the sampling resolution is not high enough or the modulation is not quite right.
Odje
Newbie
Newbie
 
Posts: 12
Joined: Sat Mar 27, 2010 7:08 am

Re: Change Transmit Carrier Frequency

Postby ian » Wed Mar 31, 2010 6:54 am

It could certainly be the sampling resolution depending on the frequency used in the remote. How does it look on the SUMP analyzer?

Can you post the acquired values? I'll try them out and look the results with the logic sniffer.
Got a question? Please ask in the forum for the fastest answers.
User avatar
ian
Crew
Crew
 
Posts: 10803
Joined: Mon Jul 06, 2009 6:14 am

Re: Change Transmit Carrier Frequency

Postby ian » Mon Apr 05, 2010 6:27 am

Hey Odje - it looks like there is a defect causing your problem. The IR LED is backwards on the Seeed preorder1 IR Toys. You can unsolder it and flip it yourself, or PM me and I'll be happy to do a repair. I'm really sorry about this bug.
http://dangerousprototypes.com/2010/04/ ... -1-defect/

Best regards,

ian
Got a question? Please ask in the forum for the fastest answers.
User avatar
ian
Crew
Crew
 
Posts: 10803
Joined: Mon Jul 06, 2009 6:14 am

Re: Change Transmit Carrier Frequency

Postby Odje » Wed Apr 07, 2010 4:54 am

Thanks Ian, I noticed the post on your blog and it immediately clicked. Just as well I went away this Easter holiday weekend otherwise I would of spent considerable time trying to figure it out. I think you might be correct with the self test passing as I checked the IR LED was transmitting with a mobile phone camera. The IR LED is a little on the dim side but I did not pay any attention to that thinking it is due to the less than average camera. I should of compared it against the IR remotes.

Anyway, these things happen. Hence the box of dud prototype boards most prototypers have. Thanks for the offer to repair but it is only 2 minutes with a soldering iron, hardly worth the effort shipping it half way around the world twice (I'm in Australia).

I'll post back with results on the weekend when I give this another go.
Odje
Newbie
Newbie
 
Posts: 12
Joined: Sat Mar 27, 2010 7:08 am

Re: Change Transmit Carrier Frequency

Postby Odje » Wed Apr 28, 2010 3:57 am

Ian,

Some ideas for future versions:
[list type=decimal]
[*]Selectable duty cycle. (NEC protocol has a duty cycle of 25% to 33%)
[*]Some way to measure the carrier frequency. Will need to add a photodiode or something.
[/list]
Odje
Newbie
Newbie
 
Posts: 12
Joined: Sat Mar 27, 2010 7:08 am

Re: Change Transmit Carrier Frequency

Postby ian » Wed Apr 28, 2010 4:09 am

Both great ideas. It should be easy to add a command for 1 with a firmware update. The measurement of carrier frequency is very interesting too.
Got a question? Please ask in the forum for the fastest answers.
User avatar
ian
Crew
Crew
 
Posts: 10803
Joined: Mon Jul 06, 2009 6:14 am


Return to USB Infrared Toy