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.

Multiple Carrier Frequencies RemoTI

I am trying to turn this into a universal remote and I have been using Timer 3 for the carrier frequency. Everything works fine for one device but if I use another device with a different carrier frequency, I run into problems.  I change the values of T3CC0 and T3CC1 accordingly but the timer only seems to run at the initial frequency. I must me missing something when I am trying to change the values in the T3CCX registers. Can someone help me out?

  • Hello Erick,


    Welcome to the E2E Community!  To further assist, can you please post your Timer 3 initialization process.     Any additional information you can provide would also be helpful.

    Thanks

    Sem Amesawu 

  • Sure thing. It is found in the HalIrGenInit() function. I am trying to change the carrier frequency by changing T3CC0 and T3CC1 on the fly....

    // Halt timer 1
      T1CTL = HAL_IRGEN_T1CTL_MODE_SUSPEND;
      
      // Set up timer 1 channel 0 to compare mode 4
      T1CCTL0 = HAL_IRGEN_TxCCTLx_CMP_CLR_SET | HAL_IRGEN_TxCCTLx_MODE_COMPARE;
      // Set up timer 1 channel 1 to compare mode 4 (active high output)
      T1CCTL1 = HAL_IRGEN_TxCCTLx_CMP_CLR_SET | HAL_IRGEN_TxCCTLx_MODE_COMPARE;
      // Run one timer 1 until output is pulled low. 
      T1CC0L = 2;
      T1CC0H = 0;
      T1CC1L = 1;
      T1CC1H = 0;
      
      // Clear timer 1
      // this will activate the output pin so start timer immediately.
      T1CNTL = 0;
      
      // Start timer 1
      T1CTL = HAL_IRGEN_BIT_TIMING_PRESCALER_DIV1 | HAL_IRGEN_T1CTL_MODE_MODULO;
      
      // wait till the single bit is cleared
      while (T1CNTL == 0);
      
      // stop timer 1
      T1CTL = HAL_IRGEN_T1CTL_MODE_SUSPEND;
      
       // -- set up carrier signal generation timer --
      // Clear counter and halt the timer
      T3CTL = HAL_IRGEN_T3CTL_CLR;
      
      // Set up timer 3 channel 0 to compare mode 4
      T3CCTL0 = HAL_IRGEN_TxCCTLx_CMP_CLR_SET | HAL_IRGEN_TxCCTLx_MODE_COMPARE;
      // Set up timer 3 channel 1 to compare mode 4
      T3CCTL1 = HAL_IRGEN_TxCCTLx_CMP_CLR_SET | HAL_IRGEN_TxCCTLx_MODE_COMPARE;
      
      // Configure timer with default carrier frequency - 38kHz
      T3CC0 = HAL_IRGEN_DEFAULT_CARRIER_DUTY_CYCLE;
      T3CC1 = HAL_IRGEN_DEFAULT_CARRIER_ACTIVE_PER;
      // Combine carrier signal (Timer 1 CH 1 and Timer 3 CH 1 output)
      IRCTL |= 1;
  • The problem was completely unrelated and I jumped to conclusions. When I scoped the frequencies, they were correct.  I had a problem with my burst pair definitions so it wasn't related to the frequency at all.

    Thank you for your reply.