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.

Sample Code Documentation

Other Parts Discussed in Thread: HALCOGEN

Hi All,

I am satring out with Hercules MCU's and am lost at the moment. please help and advise 

I have a TMS570LS4x Launchpad and istalled CCS and Halcogen I managed to generate the files for the HET to Blink the led on NHET8 pin 

so I guess the tools are working.

I am very new to Ti Controllers has worked with another vendor on 16bit t mico's however I need some help to understand where to find example 

code or a document that explains how to use the functions generated in Halcogen for example the HET in the project 0 generate a constant PWM frequency with a fixed Dutycycle ,I saw that in the genarted file there is a function to set the duty what is not clear is the parameter list for the function as it menstion RAM1 or RAM2 

and then the duty cycle in percent and the pwm channle  the last two are more or less clear butr  ,what RAM shoud I pass

I need examples for the different peripherals the documentation on the weg page AP note just tells how to use Halcogen.

Please how do I start to learn these tools and complex mcu  any advise is appreciated

Regards. 

Peter

 

  • Hi Peter,

     In HalCoGen please go to Help->Help Topics->Examples and there is a list of examples to choose from. For these example instructions to learn how to use different peripherals on the Hercules MCU. I think this is the best place to start.

     Specifically for HET, please refer to the app note here. www.ti.com/.../spna225.pdf

  • Charles thank you for the reply however before posting I looked at the example in Halcogen and it does the exact same thing as the Project 0 from launchpad it set a fixed duty cycle when the het_init() is called that does not show or tell me how to use the parameters in the pwmSetDutycycle () function generated in the het.c file .The application note I also looked at it does explain many parameters from the HET and what thy do but also does not show how to change the dutycycle during run time
    Could you show me how too use this function pwmSetDuty(ram1;pwmo;20)

    many thanks again
  • Hi Peter,

      If you go to Help->Help Topics->Modules->HET you will find all the HET API. For pwmSetDuty() please find below snippet. The first parameter is a pointer to the the HET RAM. In many of the Hercules devices there are two NHET modules. The NHET1 RAM will start at 0xFF460000 and NHET2 RAM starts at 0xFF440000. The second argument tells which pwm pin which you want to change the duty cycle. The third argument specifies the new duty cycle in terms of % you want to change to. I believe you are referring to TMS570LS04x rather than TMS5704x, correct? The 570LS04x has only one NHET module on the chip. Go to reg_het.h header file you will see #define hetRAM1 ((hetRAMBASE_t *)0xFF460000U). 

  • Just to give an example, you will call pwmSetDuty(hetRAM1, pwm0, 60) if you want to change pwm0 to 60% duty cycle. In HalcoGen HET->Pwm -07 tab, you can specify which device pin the pwm0 will connect to. For example, if you configure pwm 0 to be HET[8] then you are setting 60% onto HET[8]. Below is the default HalCoGen setting for pwm which uses HET[8] with 50% duty on a PWM period of 1000us. 

  • Hi Charles

    Thank you very much for the information ,It helped me a great deal ,

    Again thank you very much for your efforts 

    Peter

  • Hi Peter,
    Glad that your query is answered.