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.

CCS/RM48L952: HET timer based on HALCOGEN example

Part Number: RM48L952
Other Parts Discussed in Thread: HALCOGEN

Tool/software: Code Composer Studio

Hello,

Question 1)

I am working with the RM48L952 and I have taken a look into the example provided by HALCOGEN for the generation of a PWM which is based on the het timer. I am a little bit confused that the hetInt() is called once (which will start the pwm generation on the specified pins) and then you directly jump into your endless loop. I have read the documents for the het timer so I assume I know the behavior of that independent timer functionality. 

i would like to have a distinction to make the het timer (here: specified pwm output pins) run during runtime of the application depending on the application specific context. It would be similar like a start or stop pwm. I assume I could realize that when I cut off the memcpy instruction within the halcogen example for the het timer which will load the micro-instructions into the het RAM in order to be executed. But I would like to verify that with ti engineers and get a feedback or proposal how to realize it in a more clever way if possible.

Question 2)

How can I provide pure isolation of the het timer specific pins when I want to use several of them as simple GPIO and other for pwm signal generation or input captures? For the GPIO, there are several register e.g. direction, output/input, open drain/pull, set & clr in order to specify the behavior and its value. But let's assume that the dedicated pin is configured as a GPIO, but it is also used by the het program which will generate pwm signal on the same pin. Is there some overlapping happening or does this scenario never occur due to some consistency checks by the hardware itself?

  • Hi Mux,

    The pwmStop() and pwmStart() in het.c can be used to stop and start the PWM on NHET pins

         void pwmStart( hetRAMBASE_t * hetRAM, uint32 pwm);

         void pwmStop( hetRAMBASE_t * hetRAM, uint32 pwm);

    the argument pwm is the number of PWM defined in HALCoGen.

    Those two functions are to set or clear the control bit of PWCNT instructions

  • Hello,

    Thanks for the support, but I am not referring to the api within the het.h. I mean that the het reference example generated by halcogen has only two statements... hetinit and an endless loop. Depending on the halcogen configuration, after the hetinit call the pwm signal generation will start to work automatically.So there is a small time slot where the pwm signal can be seen on the ouputs before I could call pwmstop. During runtime I have to deactivate it first before activating it again depending on the application context...this is a behavior third party accessors will never accept in safety critical applications.... So both questions still remain open

  • Hello Mux,

    When the Turn-On/Off-Bit (TO) in the N2HET Global Configuration Register (HETGCR) is cleared, the timer program stops executing. As TRM states that turn-off is automatically delayed until the current timer program loop is completed. Turn-off does not affect the content of the timer RAM, ALU registers, or control registers. Turn-off resets all flags.
  • Hello QJ Wang,

    Thanks for the reply, that clarified most of the parts