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.

Hal Code Generator Example TMS570LS31x

Other Parts Discussed in Thread: HALCOGEN

Hello Together,

i have a TMDXTMS570LS31HDK and I want to run the "N2HET PWM Example" on it. If I use the complete Project Example (provided here http://processors.wiki.ti.com/index.php/Category:TMS570) it works fine, but if i try to build the Project by my self with HALCoGen and CSS the Code which is generated is a bit different and it does not work on the development board.

1321.N2HET.zip

Do you have any idea/hint what I am doing wrong?
If you need further information please ask :)

HALCoGen: 03.06.00
Code Composer Studio: 5.4.00091
ARM Compiler: 5.1

Faithfully

MaTT

  • Hello,

    you can use the HalCogen to configue the PWM module, and it will generate a HalCoGen file, then you build a CCS project, after that, you should add the HalCogen file into your ccs project. after that ,you need to set the include path, right click the ccs project, and click the properties, and then click Include Options,in the second column, you can add the add button to add the HalCogen file's "include" , then you can use it.

  • Matthais,

    Thanks for sending your project.  I think you may need to make some changes to the HalCoGen screen where you set the PWM pins as output.

    See below, see how the DIR checkbox is empty.  You need to check this on the pins that you want to be PWM outputs.

    I ran your example and it appears that the HET program is loaded:

    Although I just spot checked the first few instructions.  You could do a more through check if the pin direction issue isn't the cause.

    The other thing I see is that in the N2HET1 registers view, bits 17 and 8 are toggling as the N2HET program is running.

    However, only bit 17 and bit 0 in the direction register are set.  So you woudln't see N2HET toggle but should see 17 toggle.

    The 0x00020001 that you see in the DIR register above does seem to match the het.c code that was generated.

    But this is only turning on 2 pins as outputs - I'm guessing you are expecting more than this.

  • Hallo Anthony,

    thank you for your good and detailed explanation. Now it works fine. The Problem was that I set the wrong output.

    Furtheremore I want to test the controller with the selftest functions. Is there an example code for this?

    Regards

    Matthias