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.

MCU-PLUS-SDK-AM263X: Question regarding RTIn_RTICPUC0 register for RTI timer module

Part Number: MCU-PLUS-SDK-AM263X

Regarding RTIn_RTICPUC0 register in RTI timer module. 
The following screenshot is from data manual regarding the description of this register which works as a prescaler 



The deception mentions two equations:
1- if  CPUC0  == 0 then freq = RTICLCK/2^32 
2- if CPU0 !=0 then freq = RTICLCK/(CPUC0+1)

I have two questions here:

1-From what I understand there is no value which will pass the input frequency as it is. eg input frequency == desired output frequency. Please confirm or tell me about a way to pass the input frequency as it is.

2-There is something strange in the above two equations as they overlap in certain value e.g when 
a-CPUC0  == 0 then freq = RTICLCK/2^32 
b-CPUC0  == (2^32) -1  then freq = RTICLCK/(((2^32) -1 )+1) = RTICLCK/2^32 


So according to the mentioned two equations CPUC0 == 0 and CPUC0 == (2^32) -1 results in the same result which is RTICLCK/2^32 
So why is that? 

  • Hello Tareq,

    1) You are correct a direct input = output frequency bypass to counter is not possible. Depending on your RTICLK source, you could find a way to scale up by 32x resulting original input frequency == desired output frequency.

    2) Recall that the Up Counter (UC) is just a pre-counter to the Free Running Counter (FRC). When UC counts to it max value (32-bits = 4,294,967,295) then FRC is incremented on the next tick, which would be at UC = 0. This explains why when CPUC0 == 0, it becomes the same value, the UC counter still counts to max value, and then will increment FRC on the next tick (back at UC = 0). So, in both cases the Up Counter has to experience the same # of clock cycles. The +1 in the equation accounts for the rollover of UC back to 0 before beginning to count back up again to CPUC0.

    Best Regards,

    Zackary Fleenor

  • Thank you for your feedback 
    Then for point 2 I think putting 0 does not add any additional feature as this already could be achieved by CPUC0  == (2^32) -1 right ?

  • Correct, its a matter of readability and user preference which is used.

    Best Regards,

    Zackary Fleenor

  • Thank you Fleenor for your support

    Really appreciated