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: PWM Capturing with HET IDE Commands

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

Tool/software:

Hi, 

I'm working with TMS570 for measuring pwm frequency. But there is a problem for me. 

I tried HET IDE for PWM capturing signal,  but the signal always zero. 

Capturing reference HET commands below:

https://e2e.ti.com/support/microcontrollers/arm-based-microcontrollers-group/arm-based-microcontrollers/f/arm-based-microcontrollers-forum/1288745/tms570ls3137-pwm-capturing-code-is-working-incorrectly/4924626?tisearch=e2e-sitesearch&keymatch=%252520user%25253A574708#4924626

Where is wrong? 

How can I measure pwm capture correctly and fast. 

I want to reduce the LR time. PWM_Exp.zip

  • Hi Ali,

    This example already contains a working example right, which i attached after testings.

    Can you please carefully refer it and do all the necessary configurations once again?

    --

    Thanks & regards,
    Jagadish.

  • Hi Jagadish, 

    I tried your codes but I cannot get correct result. 

    My attempts are as follows:

    I generated PWM signals using a STM32 and I can monitor this signal with oscilloscope. 

    I applied this signal to n2het1[30] on the Hercules development board. 

    I did not produce the Halcogen code. I worked on the codes you produced: There is a Cap2 pin assignment:

    I changed you used NewcapGetSignal function to original capGetSignal function as below

    Signal is still but hercules cannot detect it.

    Unlike you, I "Excluded" the Capture_LS137 folder in Code Composer. Because I was getting an error. I think Capture_LS3137.c file duplicate one in the source folder one in the Capture_LS137 folder.

    Where am I going wrong?

    Best regards,

    Ali

  • Hi Ali,

    I generated PWM signals using a STM32 and I can monitor this signal with oscilloscope. 

    I applied this signal to n2het1[30] on the Hercules development board. 

    Did you connect the ground also between these two boards, if we didn't connect ground between these two boards then capturing will not takes place. So, make sure there is a common ground between these two.

    --
    Thanks & regards,
    Jagadish.

  • Hi Jagadish, 

    Sorry for late response.

    My working around is below step by step:

    I downloaded your capture project and imported it to my workspace. Then I compiled this code.

    I got a redefinition error for some code blocks during compilation:

    So I excluded the Capture_LS3137 folder from the compilation. After that I was successfully compiled codes. My setup as below:

    On the left side is the STM32 used for frequency generation. The frequency output is connected to pin 130 of the HDK's J11 connector (pin name B11). Ground connected between two cards.

    Here is the oscilloscope output:

    Here is the Debugging results:

    I tried cap0 and cap2 there is no different result for me, all of them periods are return 0. 

    The purpose of my cap0 and cap2 experiment is N2Het1_30 which is identified as cap2 in your Halcogen.

    Finally, I tried changing the NewcapGetSignal function to the original capGetSignal function for capturing, but it didn't work

    Also, I have a question for HET instructions. If I use the new het instructions, do I need to add some instructions to generate PWM from other het pins? Because I think this will increase the loop time.

    Thank you for your support. 

    Best regards & Have a nice day

  • Hi Ali,

    Apologies for the delayed response.

    I don't have access to my boards till Monday, i will execute this example on my board on Monday and will get back to you with updates.

    --
    Thanks & regards,
    Jagadish.

  • Hi Jagadish,

    Thank you for support. 

    Best regards

    Ali.

  • Hi Ali,

    I tested the example, and it is working as expected only. Let me explain what are the steps that i followed.

    1. First i downloaded the capture example project in from our previous thread.

    2. When i build this project then i got the build error that you are talking about:

    I rectified this error by excluding below file in the project:

    Once i excluded capture.c file in the source directory then i don't see any other build errors in my project.

    3. Now i tool another board called TMS570LC4357 Launchpad, using this board i am generating a PWM signal with 50% duty cycle and period of 100uS, and i connected this signal and along with its ground to the N2HET1_30 pin of the TMS570LS3137 HDK board.

    4. And then i run the both the codes and verified the period, frequency and duty cycle in TMS570LS3137 board and i got the below readings:

    So, the code is working without any issues from my end. Try to follow the same steps in your end as well.

    --
    Thanks & regards,
    Jagadish.