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: How to do pin mapping of HET in Code Composer Studio

Part Number: RM48L952
Other Parts Discussed in Thread: DRV8301, TMS570LS3137, HALCOGEN,

Tool/software: Code Composer Studio

Hey there'

I am using TMDXRM48 as control card which is placed on DRV8301 to drive the BLDC motor

this is my code composer studio screen shot

I have used HET1_04  with the help of GPIO pins to provide a pwm at my DRV8301 pinouts which is PWM_BH

This is the screen shot of tms(control card) of HET1_04(highlighted)

and this is the screen shot of DRV8301 AS SHOWN BELOW

but in CCS there is a het.c file which has some dedicated pins of HET as shown in the screen shot below

You can see in the screen shot that HET pin 14 is used for pwm 3 but when I am changing the the pin from 14 to pin 4 while using the same pwm 3 channel and saving the code,the desired output is not being appeared.

So please provide help,Do I have to change the address also?

  • Hello Hamid,

    First some additional background information that you should find helpful. 

    I see that the schematic you are using is actually the TMS570LS3137_CNCD schematic. Although in this case, there is little difference it could be significant for other devices. The RM48 CNCD information including examples and schematics can be found on a Wiki page at this link

    On to your primary question. The NHET1[4] pin is selected by default as the output of the MCU as shown on the schematic and in the device datasheet. In your screen grab of the schematic, you are showing the DIMM connector of the Control board which indicates that the NHET1[4] pin of the MCU (ball B12) is connected via a copper trace to the DIMM connector pin 24. In the control card schematic, the label on the DIMM is GPIO2/EPWM2A which means that the NHET1[4] pin/channel is being used in place of the GPIO2/EPWM2A signal that would normally be used since the RM48 does not have any EPWM modules and is more efficient than using a basic GPIO.

    If, you do have need to modify the pin muxing of the Hercules device, you would need to use Halcogen or review and understand the IOMM functionality in the reference manual.

    Now to address some additional information for understanding. Code Composer Studio is an IDE and only and IDE it does not have any code specifically assoviated with it, It supports a multitude of platforms that happens to include Hercules. The code/project you are running seems to be an example project for the Hercules CNCD where you are trying to drive the motor using a PWM that you are generating yourself (outside of the normal HET capability). This is not part of CCS.

    With that stated, you indicate that your are using HET channel 4 (HET1_04) with the help of GPIO pins to drive a PWM. Note that HET1_04 is NHET1[04] ball B12 on the MCU. This pin is driven through the NHET1 module and can be used in a GPIO mode but from your code above, it isn't clear what you are using GPIOPORTA for. It is also worth noting that you are setting the HET pin direction and then setting the pin high before you perform a HET initiatilzation. This will cause the information you wrote prior to the initialization to be lost.

    Finally, the last screen shot you provided is the object file as a NHET program that will be loaded into HET memory for execution. This was derived by writing a HET program and assembling it with the previously mentioned HET assembler to generate the content to be placed into HET memory. The HET program will have instructions acting on specific HET channels/pins.

  • Hey Chuck,

    actually I want to do everything in C, independent of any configuration in any GUI. Thats why i want to avoid pin mapping from halcogen. You refferd to IOMM. in which manual or reference? I

  • Hello Hamid,

    I understand that you want to do everything in C as this is a good way to learn about the MCU but keep in mind that most utilize the tools available to do their drivers and ; therefore, can focus all their attention on the application level code. As devices increase in complexity this allows faster development and shorter time to market.

    None the less, if you are going to utilize register level programming (note this is a more accurate description since even the Halcogen generated code is in C), I would highly encourage you to use the available documentation for the MCU. You can find a lot of this documentation on the product page for the RM48L952 (things like the Technical Reference Manual, Datasheet, Errata document, application notes, etc.) The reference manual for the RM48L952 is TI literature number SPNU503.

  • Hey Chuck, I can't get your point what you are saying
    Just see what I have done
    Only and only I have checked the GIO and HET drivers from HALCoGen and I am generating the PWM using Code Composer Studio so when I include the files and then after I start coding, I see the "het.c" file which I have included shows that let say HET1_08 is for channel pwm0, similarly HET1_10 is for pwm3, but when I edit the file i.e. het.c and setting my desired pin say HET1_04 and using the same pwm0 channel the desired pwm is not being generated.
    tell me how can I get my pwm on my desired pin?
    Hope u understand my problem.
  • Hello Hamid,

    Can you zip up your project to a reasonable sized and post it in this thread so I can have a look at your code? To fully explain, I need to have a look at the project to see how NHET is configured and what NHET program is included in the project you are using.
  • Hey Chuck,Any way thanks

    I have worked out on my problems and have resolved them easily.

    Take a look at my screen shot

    Now I am getting my PWMs on my PWM AH,BH,CH,AL,BL and CL pins which are connected to the gate of the MOSFETs

    Can you tell me that what should be the logic of driving a three phase bldc motor and also how to give delay between pwms as there are three phases U,V and W

  • Hello Hamid,

    Good to hear that you were able to create the PWMs that you were trying to generate. 

    In regard to driving a BLDC motor, I am, unfortunately, not an expert in motor control so I can't offer much advise for this. I assume, by delay between phases, you mean that you would like the PWMs to be timed in a way that they are out of phase by a prescribed amount? If this is the case, I believe the methodology would be to utilize counters within the NHET program to control when the edges occur for each PWM.

    There is a BLDC demo project located on our WIki page that could help in understanding how to set this up. The RM48 CNCD Wiki is located at this link : RM48 CNCD Wiki Page The BLDC demo can be found under the Demos link in the page directory. Note that the CNCD boards are no longer available so the information on this wiki may only be available for a limited amount of time moving forward.