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 in TMX570LS3137

i've gone through the technical manual of TMX570LS3137 but two things still remain unclear. firstly which timers can be reloaded at run time by OS. RTI ? NHET? how many?

secondly, hercules documentation defines 63 interrupt sources but the manual clearly says the apart from 0 1-94 are available?? so how many sources?

regards.

  • Faroze,

    We need to be really clear on what you mean by 'reloaded'.

    The RTI on the TMS570 is a little more sophisticated than what you might see on a lower end controller. 

    To get a periodic interrupt out of it, you never have to 'reload' the time base.   

    Instead the time base counter continues to count in a free running fashion.   This has some real benefits:

    1) the four compare registers are not limited to generate periods that are related to each other in any way

    2) the same free running counter that generates comparison events can be used for timestamping through the 2 capture registers

    The way that you set the period for a periodic interrupt with the RTI then is not to reload the counter but to write the period to the update compare register.

    When the compare register value matches the free running counter value,  the update compare register value is *added* to the compare register.

    For example,  let's say that the counter holds the value 100h,  the compare register holds 105h, and the update compare holds 05h 

    (edit: 10h didn't match the example sequence below.  thanks faroze for catching.)

    This is what a sequence of counts would look like:

    Counter Compare   Event Generated
    100h     105h         0
    101h     105h         0
    102h     105h         0
    103h     105h         0
    104h     105h         0
    105h     105h         1
    106h     10Ah         0       <--- Update compare value (5) was added to compare register
    107h     10Ah         0
    108h     10Ah         0
    109h     10Ah         0
    10Ah     10Ah         1
    10Bh     10Fh         0      <--- Update compare value (5) was added to compare register
    10Ch     10Fh         0
    10Dh     10Fh         0
    10Eh     10Fh         0
    10Fh     10Fh         1
     
    The N2HET answer is more complicated and depends on what the code running on the N2HET implements.  It is very flexible and you can decide exactly how you want to update it. 
    The counter values and compare values are all stored in the N2HET instruction RAM and can be written by the CPU.  You can also write the N2HET code to emulate double buffering...
    or even more than double buffering ;) 
    Re. the interrupt controller, go with the table in the datasheet.  It will be the most accurate in terms of channel numbers.   I think we were at max 64 at one time but had to expand even further on the latest devices.
    Where you see the 64 in the documentation, if you don't mind please hit the 'submit documentation feedback' button on the bottom of the PDF and report it so that it gets into the queue for the next doc. update.
    Thanks and Best Regards,
    Anthony 
  • thanx.you explained that the update value was (10h) but you added (05h) every time. what is the reason for this ....

    thnx inadvance

  • Faroze,

    Hi, Mistake on my part - thank you for catching it.

    I'll fix the post.

    -Anthony