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.

AM2634: How to configure RTI module

Part Number: AM2634
Other Parts Discussed in Thread: SYSCONFIG

How to configure RTI module?  

2634's RTI module confuses me.

Firstly, I modified RTI_LED_BLINK example to make sure LED blinks forever.

 

Fullscreen
1
2
3
4
5
6
7
8
9
10
System_init();
Board_init();
rti_led_blink(NULL);
while(1);
// Board_deinit();
// System_deinit();
return 0;
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
DebugP_log("[RTI LED Blink Test] Timer Started...\r\n");
// /* Wait until the LED is blinked specified number of times */
// while(gBlinkCount < LED_BLINK_COUNT);
//
// /* Stop the RTI counter */
// (void)RTI_counterDisable(CONFIG_RTI0_BASE_ADDR, RTI_TMR_CNT_BLK_INDEX_0);
//
// DebugP_log("[RTI LED Blink Test] Timer Stopped...\r\n");
//
// DebugP_log("All tests have passed!!\r\n");
//
// Board_driversClose();
// Drivers_close();
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Then I configure syscfg:

             set clock source to SYS_CLK, input clock frequency to 200M

             set RTI input clock source to SYS_CLK, input clock frequency to 200M

             set Counter Block 0 desired output frequency to 100M, the actual output frequency is 100M.(like step 1, set divide to 2)

             set compare event 0 tick period (usecs) to 1M, the actual tick period is 1M. 

I run the code, the LED toggles every 1s, when I see the registers, FRC0 is constantly increasing, UC0 is range in 0-199999, CPUC0 = 199999, CMP0 is constantly increasing and almost equals to FRC0

When I set Counter Block 0 desired output frequency to 2M, the actual output frequency is 2M,compare event 0 tick period (usecs) remain to 1M

I run the code, the LED toggles every 1s, FRC0 is constantly increasing, UC0 is range in 0-199999, CPUC0 = 199999, CMP0 is constantly increasing and almost equals to FRC0

When I set compare event 0 tick period (usecs) to 2M, others unchanged

I run the code, the LED toggles every 2s, FRC0 is constantly increasing, UC0 is range in 0-199999, CPUC0 = 199999, CMP0 is constantly increasing and almost equals to FRC0

so what means of register FRC0 CMP0 UC0 CPUC0, How to associate these registers with syscfg desired output frequency and tick period(usesc)?

Besides, how do I configure RTI registers like C2000 to timing code runtime?(CCS just set clock divide, PRD, read CNT)

  • I referred the manual and the introduction inside is very vague. Can you provide an example or code that matches the settings with the actual phenomenon

  • Hello Zhou,

    Sorry I have not been able to investigate this today, I will do so tomorrow. Thanks for the detailed description of your settings, I'll be able to attempt to replicate your observations with them.

    Best Regards,

    Ralph Jacobi

  • Hello Zhou,

    Apologies that it took me a while to get back to you on this post, but I was struggling to re-create your observations initially. However now I understand what is occurring. The root cause here likely isn't so much a lack of documentation but rather poor system design with SysConfig.

    The RTI registers you are looking at which are producing these values:

    FRC0 is constantly increasing, UC0 is range in 0-199999, CPUC0 = 199999, CMP0 is constantly increasing and almost equals to FRC0

    Are the registers for the RTI0 instance which is the RTI assigned to the Clock for the Driver Porting Layer. This clock defaults to RTI0. This clock is not the RTI timer you are changing the values on in the SysConfig RTI tab. Presuming your example is using the default timers, you should look at the RTI1 registers to observe changes to the registers.

    RTI1:

    RTI0:

    You will see the registers in RTI1 (or your assigned RTI in the Timer instance) changing when you shift the tick period from 1M to 2M. 

    As for the comments about the poor system design... I expect the naming versus assignment of the RTI instance is what tied you up:

    Best Regards,

    Ralph Jacobi

  • Hi Ralph

               Thank you. I've reviewed the content of syscfg again and it seems that there are only 1/2/3 instances of RTI and my RTI1 register have correct value, which is similar to timer in C2000.

    Best regards

    Nanyi Zhou