0

Convert Waveform to TV-B-Gone Code
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

Convert Waveform to TV-B-Gone Code

by canadiancow on Tue Feb 26, 2008 4:14 pm

I have a technical IR communication document from Christie (maker of many digital projectors), with the frequency, pulse width, etc., for the projector I want to turn off.

I know exactly how long the wave needs to go high and low, and at what frequency, but I'm not quite sure how to add a new code to the TV-B-Gone source to match the waveform.

Could anyone give me a hand? I've uploaded the document to http://www.canadiancow.com/christie.xls

In the first worksheet, I want to do it for the "LX35/26/33/41" column. The second worksheet gives details about frequnecy, pulse widths, active duty cycle, etc.

Or if someone can just explain to me what all the pairs of numbers in each TV code mean, I can probably do it myself.

Thanks
canadiancow
 
Posts: 11
Joined: Tue Feb 12, 2008 2:39 pm

by caitsith2 on Tue Feb 26, 2008 5:41 pm

Im assuming you want the compulsory power off code, right?

If you are going to add it into my firmware, which uses a compressed format, the code is


Code: Select all | TOGGLE FULL SIZE
const uint16_t code_LW25_times[] PROGMEM = {
   56,57,      //WAVE A 0 bit
   56,169,      //WAVE A 1 bit
   900,450,   //Leader for WAVE A
   56,4894,   //Stop Bit for WAVE A
   900,225,   //Leader for WAVE B
   56,9619,   //Stop bit for WAVE B
   56,0      //End of Code
};

const struct IrCode code_LW25 PROGMEM = {
   freq_to_timerval(38000),
   code_LW25_times,
   {
      0x02,   //Compression header, WAVE A leader
      0x00, 0x00, 0x11, 0x00,   //Custom code for LW25
      0x11, 0x11, 0x00, 0x11,   //Inverse Custom code for LW25
      0x00, 0x00, 0x01, 0x01,   //Compulsory Power off for LW25, also LX35/26/33/41
      0x11, 0x11, 0x10, 0x10, //Inverse Power off code.
      0x34, 0x54, 0x56,   //Stop bit for WAVE A + WAVE B repeated twice.   
   }
};


You can find the firmware that this code is compatible with at http://www.caitsith2.net/projects/tvbgone/


BTW, most devices are usually quite tolerant of a wide range of carrier frequencies and timing variances of the on/off periods.

EDIT: Forgot the comma's at the end of each of the times lines, fixed.
Last edited by caitsith2 on Tue Feb 26, 2008 6:03 pm, edited 1 time in total.
caitsith2
 
Posts: 217
Joined: Thu Jan 18, 2007 11:21 pm

by canadiancow on Tue Feb 26, 2008 5:45 pm

Thanks a lot. I have been using your firmware, it's great.
canadiancow
 
Posts: 11
Joined: Tue Feb 12, 2008 2:39 pm

by canadiancow on Tue Feb 26, 2008 5:53 pm

In the code_LW25_times, I'm assuming there should be commas at the end of each line.
canadiancow
 
Posts: 11
Joined: Tue Feb 12, 2008 2:39 pm

by caitsith2 on Tue Feb 26, 2008 6:02 pm

Yeah, forgot the commas. They should be there.
caitsith2
 
Posts: 217
Joined: Thu Jan 18, 2007 11:21 pm

by canadiancow on Wed Feb 27, 2008 4:40 pm

I'm just wondering how the "0xA1" in the specs turned into "0x00, 0x00, 0x01, 0x01"

I'm trying to determine the reason it's not working, and while it could be that I'm not getting a good enough shot at the receiver (I'm trying to do this without 100 people noticing me), it could also be that the code's wrong.

I might try the regular power code later (as I have no reference for what the "compulsory power off" code is supposed to do), but it needs to be sent twice to turn off the projector.
canadiancow
 
Posts: 11
Joined: Tue Feb 12, 2008 2:39 pm

by caitsith2 on Wed Feb 27, 2008 5:46 pm

Code: Select all | TOGGLE FULL SIZE
const uint16_t code_LW25_times[] PROGMEM = {
   56,57,      //WAVE A 0 bit
   56,169,      //WAVE A 1 bit
   900,450,   //Leader for WAVE A
   56,4894,   //Stop Bit for WAVE A
   900,225,   //Leader for WAVE B
   56,9619,   //Stop bit for WAVE B
   56,0      //End of Code
};

const struct IrCode code_LW25 PROGMEM = {
   freq_to_timerval(38000),
   code_LW25_times,
   {
      0x02,   //Compression header, WAVE A leader
      0x00, 0x00, 0x11, 0x00,   //Custom code for LW25
      0x11, 0x11, 0x00, 0x11,   //Inverse Custom code for LW25
      0x10, 0x00, 0x01, 0x01,   //Compulsory Power off for LW25, also LX35/26/33/41
      0x01, 0x11, 0x10, 0x10, //Inverse Power off code.
      0x34, 0x54, 0x56,   //Stop bit for WAVE A + WAVE B repeated twice.   
   }
};


Ooops, Corrected the error. 0xA1 was supposed to become 0x10, 0x00, 0x01, 0x01.

If you wish to try the normal On/Off code, then use
Code: Select all | TOGGLE FULL SIZE
const struct IrCode code_LW25 PROGMEM = {
   freq_to_timerval(38000),
   code_LW25_times,
   {
      0x02,   //Compression header, WAVE A leader
      0x00, 0x00, 0x11, 0x00,   //Custom code for LW25
      0x11, 0x11, 0x00, 0x11,   //Inverse Custom code for LW25
      0x00, 0x00, 0x00, 0x00   //Normal On/Off codefor LW25, also LX35/26/33/41
      0x11, 0x11, 0x11, 0x11, //Inverse Power off code.
      0x34, 0x54, 0x56,   //Stop bit for WAVE A + WAVE B repeated twice.   
   }
caitsith2
 
Posts: 217
Joined: Thu Jan 18, 2007 11:21 pm

by canadiancow on Wed Feb 27, 2008 6:24 pm

Excellent, thanks. I'll give it a try tomorrow.
canadiancow
 
Posts: 11
Joined: Tue Feb 12, 2008 2:39 pm

Please be positive and constructive with your questions and comments.