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 PWM Generation

Part Number: TMS570LS3137
Other Parts Discussed in Thread: HALCOGEN

Tool/software:

Hello everyone,

I have carefully studied the following resources:

  • TMS570LS3137 Reference Manual

  • PWM Generation and Input Capture Using HALCoGen N2HET Module

  • NHET Getting Started Application Notes

I understand both the general and detailed concepts of generating PWM signals using the N2HET peripheral.

Below are my current configuration and observations:

  • VCLK2 clock: 160 MHz

  • HR Prescaler: 0 (HR Clock = 160 MHz)

  • LR Prescaler: 64 (Loop Resolution Period = 400 ns)

  • Time Slot: 64

After generating the N2HET code using HALCoGen, I made the following manual modifications:

  1. PWCNT (Instruction 1):

    • Program field is modified to 0x000054C0U to disable HR delay (I want the PWM resolution in multiples of the loop time, 400 ns. I do not need HR delay).

  2. MOV64 (Instruction 41 - duty cycle update):

    • Data area is set to 256, My purpose is to have pulse changing on each 400ns.

  3. MOV64 (Instruction 42 - period update):

    • Data area is set to 256, targeting an 800 ns total period.

After these changes, my perspective is that value located instruction 41 will be loaded to PWCNT data field and this data field will be decremented on each 400 ns(loop time). When it reaches zero, pin action will be performed and I am expecting that opposite pin action will be performed within 400 ns. Also, as Instruction 42 has 256 value, DJZ instruction data field will have 256 value and I am expecting that period will be 800ns. 

As a result, after I performed following changes, I supposed that I will have a PWM signal with 800 ns period and %50 duty. However, I cannot take this pwm signal.

Could you help me identify precisely what I may have misunderstood or misconfigured? I am looking for specific guidance rather than general suggestions to ensure I grasp every detail I may have missed.