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.

TMS570LC4357: How to set RTI UC Copare in Halcogen

Part Number: TMS570LC4357
Other Parts Discussed in Thread: HALCOGEN

Hello, 

Very simple question from a beginner. 

I am not able to set the RTI UC Compare register (CPUCx) in Halgogen. Where is it possible? 

Thanks for all . 

Alain

  • Hello Alain,

    The RTI module has 2 counter blocks and 4 compare units. The counter block is driven by the RTICLK and counts up (RTIUCx) until the compare value in the compare up counter register (RTICPUCx) is reached. When the compare matches, RTIFRCx (free running) is incremented and RTIUCx (up counter) is reset to 0.

    The counter values (up counter, and free running counter) can be determined by reading the respective counter registers. A write to this counter presets it with a value. The counter then increments from this written value upwards.

    In HalCoGen, you are not able to write a value to UCx register. The code generated through HALCoGen presets those register in rtiInit(). 

  • So in a nutshell -  the UCx is  like a pre scale for the counter. 

    Increase UC, and the counter resolution decreases (each step is longer in 'ns') but the range of the counter between rollovers is longer (in 'ns' again)

  • Hello, 

    Thanks, but my question was not well writen. I have understood the behavior of the RTI and I know how to set UCx, but I don't know how to do it in Halcogen. 

    I have this display (RTI-> RTI Counter 0):

    I dont know how to change the "7". It came from somewhere, but where? 

    Thanks

    Alain