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.

Timers on TMS570?

Other Parts Discussed in Thread: HALCOGEN

Hello,

I have some problems understanding the concept of timers on the TMS570, because it is pretty different to other MCs.

I found only the NHET and the RTI.

I'm not sure if I use the modules as they are supposed to.

NHET: i would use it for PWM and PW Measurement only. What else is it supposed to be used for?

RTI: Creating Tasks. It has afaik only 4 compare registers for those 2 counters. --> max. 4 tasks/tick rates. What else is the RTI supposed to be used for?

If i have an application running on my basic software, which needs a Timer, are there any other Timers on that Processor? Or is it only possible to realise that, by using a Task?  (with a minimum tickrate of 1ms?)

Thx!

  • Hello R.K.,

    before you get a sophisticated reply by TI experts, let me simply answer your queries. Most of information you will retrieve from technical reference manual available on this link http://www.ti.com/lit/ug/spnu499a/spnu499a.pdf.

    Have a look at pages 426 (13 Real time interrupt module) and 762 (20 High-End Timer Module) and also go through tabs of HalCoGen tool.

    Further both modules can be use e.g. to trigger an A/D conversion of internal of external converters. 

    NHET provides you with quite wide spectrum of functionality - actually it is a state machine executing micro-code written in assembler (a bit different to "usual" assemblers ;-)). Maybe a better way to begin with NHET is to utilize HalCoGen or HET IDE.

    AFAIK RTI can supply a 1us (1MHz) period to a task timer. Yes, in this case the RTI module works as compare of ordinary CAPCOM. But it can also play a role of capture of CAPCOM - each of RTI counters (0 and 1) can be triggered by an interrupt event (interrupts 0-63 can be use to drive that) to capture a timestamp of such an event.

    Good luck,

    Cheers, Jiri

  • Hello Jiri,

    actually, I have already read much about the NHET, generated Code with HalCoGen and also written my own Code in the HET IDE for 8 PWM Channels, which also works. (I have also written in this Code an edge detect with ECNT and capture with PCNT)

    My problem is just that I don't know if there is also a usual timer, because i guess that the NHET is supposed to be used only for input/output signals, rather than for usual timer interrupt functions. (it also has only 2 different interrupt priority levels)

    I have also looked at the settings for the RTI in HalCoGen. And I found out, that there are only 4 different time ticks to choose. I guess those are supposed to be used for different Tasks.

    But I still don't know what I should do, if i needed just 5 different Timers ( start them on application level) which call a function every x ms..

    regards,

    rk

  • Hi RK.

    Most RTOS's will just use one base tick rate and let you schedule different tasks to be executed at different multiples of the base tick rate.

    The RTI is the timer that gets used for this purpose.

    The 3 extra comparators in the RTI are there so you can also schedule events that aren't a multiple of the base tick rate of the OS.  That comes in handy.

    The RTI also has input captures you can use to timestamp events if you chose.   

    Now, if you ever want to benchmark an algorithm,  take a look at the PMU that comes with the CPU - it can be accessed rather quickly and it's not memory mapped so you don't need pointers to get to it - you just need to be in a privilege mode to use this counter.  It's got one free running cycle counter that's exactly at the CPU clock rate (which is easier to work with than RTI for benchmarking) and you can also measure events on the system like instruction cycle stalls or the # of dual issues ... this can help you if you're optimizing code.   There's a driver for PMU inside HalCoGen.

    Best Regards,

    Anthony

  • Hi Anthony,

    Thx for your answer,

    i will take a look at the PMU aswell!

    Best Regards,

    rk