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.

RDK Value SB

hi,

        i am referring to value sound bar design from TI. now my sound bar is working, except IR remote. I want to use RC-5 protocol for that. please guide me in the selection of proper IR receiver and transmitter(remote). Also some code is there for IR in MSP430 code, but it is not working. Please explain me what are the changes i need to in code so that it will work for the selected remote and IR receiver. 

                             Thanking you sir.

Regards,

Srinivas. T

  • Hi, Srinivas,

    The supplied MSP430 code supports RC-5. Are you sure there is not a problem with your hardware?

    -d2

  • hi,

          The hardware is working perfectly. The IR part is not working may be because codes that the remote sending are not matching with the one in program OR the receiver is not synchronizing with remote. My Receiver is operating at 38khz. Will this be useful to receive RC-5 remote signals?

           I am also confused how to select an RC-5 Remote and how to get commands for respective buttons on the remote. Please guide me on these things?

  • continue with previous mail:

          In the code both RC-5 and NEC protocol programs are there. Do i need to remove NEC code, since i am using RC-5 protocol.

                    Thanking you sir.

    Regards,

    Srinivas. T

  • Hi Srinivas,

    The RC-5 protocol will determine the commands sent from the different buttons and all remotes using that protocol should work the same. Furthermore, the NEC code does not need to be removed.

    Are you using the IR receiver that came with the Value SB? Are you able to read the data coming out the IR receiver and check if it is matching the RC-5 protocol?

    Regards,

    ~John

  • Hi john,

                 I am using the same IR Receiver came with Value SB. The Receiver is able to receive the signals sent by Remote and I am able to view them on CRO. I have replaced these commands in the program code also. Still it is not responding to the remote. The remote is also 38kHz one.

    The code is given below:

    IR.C:

    typedef struct
    {
    unsigned char nAddress;
    unsigned char nCommand;
    } TIR;

    TIR ReadIR_RC5(void) //returns address and command
    {
    unsigned int n;
    unsigned int nBit;
    unsigned int pBits[RC5_BITS];
    TIR rc5Data;
    rc5Data.nAddress = 0;
    rc5Data.nCommand = 0;

    for (nBit = 0; nBit < RC5_BITS; nBit++)
    {
    pBits[nBit] = (~P1IN_bit.P1IN_2) & 0x01;
    for (n = 0; n < 2762; n++);
    }

    rc5Data.nAddress = 0;
    for (nBit = 0; nBit < 5; nBit++)
    rc5Data.nAddress |= pBits[7 - nBit] << nBit;

    rc5Data.nCommand = 0;
    for (nBit = 0; nBit < 6; nBit++)
    rc5Data.nCommand |= pBits[13 - nBit] << nBit;

    return rc5Data;
    }

    void DispatchIR_RC5(TIR rc5Data)
    {
    if (!rc5Data.nAddress && !rc5Data.nCommand) return;

    if (rc5Data.nAddress != RC5_ADDRESS) return;

    switch (rc5Data.nCommand)
    {
    case RC5_CMD_VOL_UP:
    Buttons(volumeUp);
    break;
    case RC5_CMD_VOL_DN:
    Buttons(volumeDown);
    break;
    case RC5_CMD_MUTE:
    Buttons(muteMode);
    Delay_ms(1000);
    break;
    default:;
    }
    }

    void ProcessIR(void)
    {
    // TIR necData = ReadIR_NEC();
    // DispatchIR_NEC(necData);
    TIR irData = ReadIR_RC5();
    DispatchIR_RC5(irData);
    }

    IR.h:

    #ifndef __IR_H
    #define __IR_H

    #define RC5_BITS 14

    #define RC5_ADDRESS 0x00
    #define RC5_CMD_VOL_UP 0x01
    #define RC5_CMD_VOL_DN 0x02
    #define RC5_CMD_MUTE 0x03

    void ProcessIR(void);

    #endif

    Please check  the code and kindly tell me where it is going wrong.

    Regards,

    Srinvas. T

  • Hi Srinvas,

    Unfortunately, I will not be able to help you debug your code. The value soundbar uses a TSOP34838 IR Receiver that supports 38KHz, so that should not be the issue.

    You say you are able to view the commands and they are different from the ones in the code? Do the commands match the RC-5 protocol?

    Regards,

    ~John

  • Hi John,

                   The commands are different. I have measured pulse width of each bit. It is nearly same as RC5 (1.7ms+50us tolarance). I thought there may be synchronization problem.

               for (n = 0; n < 2762; n++);   If make any changes in the number in the for loop, wll it be helpful? so that required pulse width comes.

    Regards,

    srinivas. T,

  • Hi Srinivas,

    Well, it sounds like the remote isn't a true RC-5 remote if the commands are not the same. I would recommend trying to find another RC-5 remote that follows the protocol.

    I think instead of changing the code in the MSP430, as that could take a lot of tweeking, getting the proper remote would work best.

    Regards,

    ~John