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.

CC2541 sample code for IR Generation & Learning

Other Parts Discussed in Thread: CC2541, CC2538, CC2530, CC2533

We want to add the IR Generation & Learning in our CC2541 based device,

so can you please provide me the details on how can we do it with a sample code for it ?

From (http://www.ti.com/general/docs/litabsmultiplefilelist.tsp?literatureNumber=swra323) I could know that 

HAL files for the NEC,SIRC & RC5 were available for CC2538 is it available for CC2541 if yes please guide me how can i add it into our simple BLE Peripheral device & If it is not can you provide me the HAL files & procedure to add it?

  • Hi Rushit,

    The files you are linking to are for CC2530 and CC2533. These are very similar devices to the CC2541 so you should be able to use the code as-is.

    Cheers,
    Fredrik

  • fedrik : Thanks for the response but i am not able to access therefore codes & get it,therefore trying to work on the procedures given by CC2541's user guide to get the IR signal out by timer 1 & Timer 3.

    1.Please tell me how to do the calculation to set the value of T3CC1(duty cycle = 33%) & T3CC0 (period to have carrier 38Khz waveform).If possible with example 

    2.Please tell me how to do the calculation to set the value of T1CCH0 & L0(mark = 560 us) & T1CCH1 & L1 (total ). If possible with example

    3.On which Peripheral pin i will get the IR out signal(I tried to look on every pin but cannot get it) & setting for that?

    Please find below my code for the Details :

    T1CTL = 0x02;Configuration
    T1CCTL0 = 0x64;Configuration
    T3CCTL0 = 0x64;Configuration


    T3CC1 = 127; // Carrier wave duty cycle Need to Calculate
    T3CC0 = 0xff; // PWM signal period Need to Calculate

    T3CTL = 0x12; // start */ ; Is it required in our case ?

    T1CC0H = 0x12;  // Need to Calculate
    T1CC0L = 0x12;  // Need to Calculate
    T1CC1H = 0x06;  // Need to Calculate
    T1CC1L = 0x06;  // Need to Calculate

    I am running short on time & could not find details or any example code on this,so please guide me on this asap?

  • Hi Rushit,

    What do you mean you are not able to get the code? It is a link to a zip file on the page you are linking to in your first post.

    BR,

    Fredrik

  • The IR signal will be output on P1.1.


    Fredrik

  • Thanks Fredrik for the details.
  • Hey Fredrik
    Is there a provision to redirect the IR out to an alternate pin instead of the P1.1.....??


    MSR
  • Well no worries it seems the IR out is just T1 Ch1 out so using alternate location -1 for timer 1 the IR-OUT signal can be obtained on P0.3 as well.



    --
    MSR

  • Just for your Info : CC2541 user guide page no.79 section 7.3(GPIO) : "The output drive strength is 4 mA on all outputs, except for the two high-drive outputs, P1.0 and P1.1,which each have 20-mA output drive strength".

    On P0.3 you will get only 4mA output current,Therefore IR out is recommended to be on P1.1 which have 20mA output current.