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/TMS320F280049: F280049M: How to use TRREM register for High-resolution Period and Phase operation

Part Number: TMS320F280049
Other Parts Discussed in Thread: C2000WARE, TMDSCNCD28379D, TMDSCNCD280049C

Tool/software: Code Composer Studio

Hi,

I'm trying to use High resolution Period and Phase function for multi-phase digital power application.

When I asked to our FAE about High resolution function, they introduced following threads.

https://e2e.ti.com/support/microcontrollers/c2000/f/171/p/712837/2627948?tisearch=e2e-quicksearch&keymatch=TBPHSHRLOADE#2627948 

e2e.ti.com/.../2603930

In these threads and example,  access to " TRREM" register are found instead of access to "TBPHSHR".

There is little information about "TRREM" register in reference manual.

Could you explain the detail about "TRREM" register?

I’m attaching  current EPWM initialization code for open control test without using TRREM register.

There is some jittering at slave phase waveform when TBPRDHR or TBPHSHR is not zero.

EPWM_init.c
Fullscreen
1
2
3
4
5
6
7
8
/*
* EPWM.c
*
* Created on: 2018/07/10
* Author: onishi
*/
#include "EPWM_init.h"
#include "f28004x_device.h"
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Best regards, 

Hiroyuki Onishi

  • Hi Onishi-san,

    Here's a description of the TRREM register:

    This value keeps track of the remainder portion of the HRPWM hardware calculations.

    Notes:  

    [1] The lower 8-bits of the TRREM register can be automatically initialized with the TBPHSHR value on a SYNCIN or TBCTL[SWFSYNC] event or DC event  (if enabled). The user can also write a value with the CPU.           

    [2] Priority of TRREM register updates:

    Sync (software or hardware) TBPHSHR copied to TRREM     Highest Priority

    HRPWM Hardware (updates TRREM register)                        Next priority

    CPU Write To TRREM Register                                               Lowest Priority

    The C2000Ware example mentioned in the following post is the best place to find out how to use this register in your code.

    CCS/TMS320F28379D: HRPWM Question - C2000 microcontrollers forum - C2000™︎ microcontrollers - TI E2E...

    e2e.ti.com
    Part Number: TMS320F28379D Other Parts Discussed in Thread: C2000WARE Tool/software: Code Composer Studio Hello everyone, I am making now one project with 8 PWMs
     

    I hope this helps.

    Hrishi

  • Hi Hrishi-san,

    Thank you very much for your quick reply.

    The example and your post is helpful for understanding TRREM register.

    Let me ask you another question.

    When I test the example without sweep operation, rare jittering still exists.

    Can I avoid this jittering?

    yellow : EPWM1 - A, blue EPWM2 - A

    Best regards,

    Hiroyuki Onishi

  • Hi Onishi-san,

    You should not see any jitter. How are you stopping the sweep? How often do you see this jitter? Do you see it every time you stop the sweep or only sometimes and at random points (randow TBPRD, values)?

    Have you modified anything at all in the example? Also, which device are you testing this with?

    Thank you.
    Hrishi
  • Hi Hrishi-san,

     I'd like to attach another picture and other information.

    ・>How are you stopping the sweep?

    I cannot get this picture when oscilloscope setting is standard.

    After enabling Persistence function of oscilloscope, I got this results.

    ・>How often do you see this jitter?

    only one pulse in ten seconds.

    ・>Do you see it every time you stop the sweep or only sometimes and at random points (randow TBPRD, values)?

    I tested following 3 parameters and all results have jittering.

    -TBPRD : 50, TBPRDHR : 128 << 8

    -TBPRD : 70, TBPRDHR : 64 << 8

    -TBPRD : 100, TBPRDHR : 20 << 8

    ・>which device are you testing this with?

    I tested following 2 control card.

    TMDSCNCD28379D : jitter found.

    TMDSCNCD280049C: no jitter. (soucecode is ported form 2837xd example code.)

    ・>Have you modified anything at all in the example?

    I'd like to attach 2 project folder.

    hrpwm_deadband_sfo_cpu01.ziphrpwm_deadband_sfo_cpu01_F280049M.zip

    The main change is to remove sweep for loop.

    If you need any other information, please let me know.

    Best regards,

    Hiroyuki Onishi

  • Onishi-san,

    Thank you for providing this information.

    It looks like the PWM period value is only 70 counts in your code. Please change this back to the minimum period value (360d) that is used in the example project. The reason for this is that there is some time-critical code that needs to execute in a synchronized fashion with respect to the PWM switching cycle. If the PWM period is too small, the time critical code execution may not meet timing requirements with respect to the switching cycle. This might be the reason why you see jitter on the PWM output. The example code restricts the minimum period for this reason. You could optimize the time-critical code and/or move it to the CLA to push this restriction further i.e. allow higher switching frequency. 

    I hope this helps.

    Hrishi

  • Hrishi-san,

    Thank you for your advice.

    I tried to increase TBPRD to (400d) and set TBPRDHR to (360d << 8) with TMDSCNCD280049C . Jitter is still found in waveform, so I watched TRREM register value to check what is going on.

    Whenever I set TRREM register in sourcecode, TRREM register value is automatically over-written in each PWM cycles. If the difference between over-writed TRREM register value and coded TRREM register value (higher than about 150d or 200d),jittering seems occuring.

    I think current method is not suitable for smooth transition in high freaquency operation, so I'd like to try to find another method.

    I understand a lot of things about TRREM, and I'd wolud like to close this thread.

    Thank you very much for your help. When I have questions about another method, I will post new thread.

    Best reagards,

    Hiroyuki Onishi