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.

TMS570LS3137: TMS570LS3137

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

Hi,

I am trying to capture pwm signals with N2HET pins by using TMS570LS3137.I generated code with halcogen to capture pwm signals. But there is a problem. When i try to capture different pwm signals with het pin 0-7 , this pins doestn work clearly. I notice that, when I activated bit HR share option, pwm signal captured. But in this case, I captured signals only odd pins. Can I capture pwm signals with tihs MCU, if I can, can I capture signals with all N2het pins?

  • Hi Turhan Kalem,

    Can you please let me know, exactly on what pins you are getting issue?

    I will try to implement the capture for those pins on my end.

    --

    Thanks & Regards,
    Jagadish.

  • Hi Jagadish,

    There are two situation that I tried;

    First is, I configrated het pins that are 0-7 pins for capture signal and I didn't choose HR share selection. I gave a pwm signal from logic analyzer to HETpin-0, In this case MCU couldnt capture signal  Then i subtract the pwm signal cable  from the HETpin-0 and I pluged in the pwm signal cable to HETpin-1. After that, MCU captured correct signal. I tried to other pins the same process,  The same things happend again. By the way, when I captured the correct signal, then I changed the signal duty and frequency, After that, MCU couldnt captured correct signal.  

    Second case is,I configrated het pins that are 0-7 pins for capture signal and I choose HR share selection.I give a pwm signal from logic analyzer to HETpin-0, In this case MCU captured correct signal. But in this situation, MCU couldnt capture pwm signal odd pins (HETpin 1-3-5-7).

    I added a folder that has codes according to first case, you can check it. 

    --

    Thanks & Regards,

    hercules_pwm_example.zip

  • Hi,

    I didn't get what do you mean by "didn't choose HR share" AND "choose HR share" in your point of view.

    So, please share two captures for those.

    --
    Thanks & regards,
    Jagadish.

  • Hi,

    I added a screenshot. You can check it.

    Thanks for your help.

  • Hi Turhan,

    Yes, you are right.

    If we are using HALCoGen for period and duty cycle capturing, then it is necessary to choose the HR share. This is because,

    If you verify capGetSignal function definition:

    As you can see here pwmDuty cycle for capture-0 is capturing from instruction-25 and pwmPeriod for capture-0 is capturing from instruction-26. 

    Now if we verify N2HET code for instruction-25 and instruction-26:

    Instruction-25 (pwmDuty) uses the pin-0 and isntruction-26(pwmPeriod) uses the pin-1. So to measure the period and duty cycle we should use the HR share (this HR share will take the signal from HET pin-0 and supply it to the both the HR internally).

    Or else you can do two more other things:

    1. Manually changing the N2HET code generated by HALCoGen:

    I am manually changing the instruction-26 to use the pin-0 instead of pin-1, so now my period will also get capture from the pin-0 only instead of from pin-1.

    This is easy method, but this is not a good method because if you regenerate the code from HALCoGen, your manual changes will be gone.

    2. You can write your own HET instructions using HET IDE. Something as mentioned in below thread:

    (+) RM48L952: Period Capture for more than 8 signals - Arm-based microcontrollers forum - Arm-based microcontrollers - TI E2E support forums

    --
    Thanks & regards,
    Jagadish.