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.

Zlight2 design, what is T1CNTH/T1CNTL used as

Other Parts Discussed in Thread: Z-STACK

Dear TI Folks,

My customer would like to check if T1CNTH/T1CNTL were used in the Zlight2 design. If they were used, what there are used for?

Thanks,

Best regards,

Weiren

  • As I know, T1CNTH and T1CNTL are not used in ZLight2 design. However, timer1 is used for PWM to drive LED.
  • Hi YK,

    thanks for your answer.

    My customer has some further questions on this, hope you can help.

    So for the case of Zlight2,

    Question 1 : “Can I use T1CNTH/T1CNTL registers as PWM frequency instead of using T1CC0 right?”

    Question 2 :"If the answer to Question 1 is "Can" , could you briefly advise how to do it?"

    Thanks alot

    Regards,
    Weiren
  • I don't know how to use T1CNTH/T1CNTL registers as PWM frequency instead of using T1CC0. The existing PWM driver already uses Timer 1 and works well. Why does your customer intend to do so? I would suggest you to use Z-Stack driver to do PWM. By the way, you can refer to Chapter Timer 1 (16-Bit Timer) in CC253x user's guide.

  • Hi YK,

    Thanks for your advise so far, appreciated.

    We have discussed with the customer to find out more and below is the background and reason. We also have some questions hope that either you or TI folks supporting the Zlight 2 can help to address.


    Background
    My customer made some modifications to the Zlight 2 original design by using P0.2, P0.3 and P0.4 to drive LEDs. Then realized that in original Zlight 2 design, P0.2 were used to generate the 233Hz PWM.
    Now with hardware been fixed, they need to find other way to generate the 233Hz PWM.

    Questions

    1. Can we set the 233Hz PWM to other unused channel of timer 1? Currently, T1CC3 and T1CC4 is not used according to my customer.

    2. If the answer to question 1 is "Yes", is it by changing parameter " channel" in the last line of the below?

    Code reference : Hal_Timer.c
    void halTimer1SetChannelDuty (uint8 channel, uint16 promill)
    {
    #define MIN_PROMILL 20
    uint16 count;

    if (promill < MIN_PROMILL)
    promill = 0;

    /* Load count = ((sec/tick) x clock) / prescale */
    count = (uint16)( ((uint32)(Timer1MaxCount) * promill + 500)/ 1000 );
    count = ( (count >= Timer1MaxCount) ? Timer1MaxCount-1 : (count == 0 ? 1 : count) );

    halTimer1SetChannelCount(channel, count); //
    }

    3. If question 2's approach is feasible, could you advise what others modifications are required so the functions of the original design can be replicated just by channel the responsibility of Timer Channel 1 to unused Timer Channel X


    We welcome inputs from TI's Engineer too, please give us your valuable inputs. Thanks.


    Regards,
    Weiren
  • You can refer to CC253x/4x User's Guide (Rev. F) and try to revise the code.

  • Hi YK,

    Thanks for your recommendation. We will try to see if we can get the coding support/guidance from TI for this customer.

    Hi TI Folks,

    Can any of the TI Engineers help on this? Our customer needs coding level of support and advise. Appreciate if the author of this code could help.

    Regards,
    Weiren
  • You are welcome and I suggest you to call TI local representative to help you on this. Where do you base?
  • Hi YK,

    I am base in Singapore. Already in contact with TI with regards to this request.

    Understands that the E2E forum has a lot of active and experienced members, and TI Engineers are also actively supporting the forum.
    So, we are working concurrently to address my customer's concern in the E2E and within TI.

    Thanks for your advise and concern, appreciated.

    Regards,
    Weiren
  • I see and Good luck!