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.

TMS320F280049C: TBPRDHRM definition missing from f28004x_epwm.h

Part Number: TMS320F280049C
Other Parts Discussed in Thread: C2000WARE

As the title says, TBPRDHRM definition is missing from f28004x_epwm.h. At least from C2000Ware V1.00.06.00.

JHi

  • I'm guessing you're porting code from an older device that did have a TBPRDHRM register? There were memory map improvements on more recent devices (like the F28004x) that made the mirror register unnecessary. F28004x does not have a TBPRDHRM register--you can just use TBPRDHR instead.

    Whitney

  • Actually I got the register name from the hrpwm_ex2_prdupdown_sfo_v8 example for f28004x. And there is a 32-bit register for all the other HRPWM parameters but not for period, why? And the 32-bit write is also mentioned in TMS320F28004x Piccolo Microcontrollers Technical Reference Manual. So I think it is missing.

    JHi
  • I see. I'll get that comment removed from the example to avoid future confusion.

    I'll need to ask some colleagues about why the header file supports 32-bit writes for some and not others. I'll get back to you.

    Whitney
  • Okay, so I've confirmed there's no issue with doing 32-bit writes. The header files may not support it by default but you could do something like

    *((uint32_t *)&EPwm1Regs.TBPRDHR) = 0x12345600;

    Whitney
  • I have already added:

    EPWM_REGS ->

    Uint16                                   TBPRDHR;                      // Time Base Period High Resolution Register

    Uint16                                   TBPRD;                        // Time Base Period Register

    => union   TBPRD_REG                        TBPRDM;                       // Union of TBPRD:TBPRDHR

    struct TBPRD_BITS {                     // bits description
       Uint16  TBPRDHR:16;                  // 15:0 Extension register for HRPWM Period (8 bits)
       Uint16  TBPRD:16;                    // 31:16 Timebase Period Register
    };

    union TBPRD_REG {
       Uint32 all;
       struct TBPRD_BITS bit;
    };

    JHi