This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

IR raw duration generation problem

Other Parts Discussed in Thread: REMOTI

Hi,

I have been looking around in this forum but couldn`t find anything useful on this. I've found that RemoTI used to have an IR generation module.. but it didn`t work, and now i have downloaded RemoTI and even in the documentation this modulo doesn't exist.

I tried this topic (only one in this subject?): http://e2e.ti.com/support/low_power_rf/f/159/t/18207.aspx

But the code that is supposed to work is not documented and i didn't understand it.

I need to send raw durations IR signals. Could anyone help me on this?

  • Hello Daniel,

    You could go with a modified RC5 remote control program that would allow you to create your own IR transmissions.  There is lots of documentation on the RC5 standard and it can be used to create a very robust data link. 

    It is based on this file for Receiver file. It would look something like this:

    void timer2_int(void) interrupt 5{
    static bit  reset_IR = 0;
    if (keypressed == 0){
        timer2L++;                                      //increment low counter
        acc_timer++;
        if(acc_timer == 0) timer2H++;                //if timer2L overflows incr timer2H
           IR_Signal = P3_2;                            // IR value
        switch (Ir_Step){
    //
    // timer2L is allowed to accumulate if signal is High
    // if signal stays high or low for more than 131ms then the IR is reset
    // if the signal is low it has to go high and stay high for more than 3.5ms
    // timer2L is reset if a low is detected allowing for a minimum low signal time
    //
        case IR_START1_STEP_1:
            if ((timer2L > 15 && timer2L < 22) && (IR_Signal == 1)){// If startbit less than 1.1ms
                temp = timer2L;                        // measure start bit low pulse width after
                timer2L = 0;                        // the first Positive edge of 1st start bit 1
                ref1 = temp;                        
                ref1 = ref1 >> 1;                    // timer is 1/2 bit time
                ref2 = ref1;                        // calculate 1/2, 3/4 & 5/4 bit time
                ref1 = ref1 + temp;                    // ref1 = 3/4 bit time
                temp = temp << 1;
                ref2 = ref2 + temp;                    // ref2 = 5/4 bit time
                   Ir_Step = IR_START2_STEP_2;
            }else{
                if (timer2L > 22) reset_IR = true;
            }
        break;
        case IR_START2_STEP_2:                            // test falling edge of StartBit 2
            if ((timer2L < ref1) && (IR_Signal == 0)){    // Synchronize on falling edge
    ...

    For the transmitter you would modify this Transmitter file. That would look something like this:

        if (transmitting_IR) {                     // check for transmit interrupt
            bitcount = 8;
            if (trans_ctr <= trans_size) {         // see if all data is output
                if (trans_ctr == (trans_size)) {// send checksum as last byte
                    transmitting_IR = 0;
                    ET0 = 0;
                    TR0 = 0;
                    P3_7 = 0;
                }else{
                     if(trans_ctr < (trans_size-1)){              // send checksum as last byte
                        IRData = trans_buf[trans_ctr];             // send current byte
                        trans_chksum += trans_buf[trans_ctr];     // update checksum
                    }else{
                     if(trans_ctr == trans_size-1)
                        IRData = trans_chksum;
                    }
                    transmit_IR = true;
                    Ir_tick = max_bit_length;
                }
                    trans_ctr++;                 // move the output index up
            }
             while(transmit_IR){                    // Start of IR data transmission
                if (Ir_tick >= max_bit_length){    // if timer0 ticks > total time for bit transfer
                    if (bitcount > 0){            // and if not at last bit
                        ACC = IRData;            // put IRData into ACC for shifting

    ...

    ...

                    }
                }// end 2nd half of bit transmission    
            }// end 1 byte of transmitted data
        }// end total transmission time

  • hi, have you solve it out?  i meet trouble as same as you, can you tell me how to do?