SPRACO5 September 2019 F29H850TU , F29H859TU-Q1 , TMS320F280021 , TMS320F280021-Q1 , TMS320F280023 , TMS320F280023-Q1 , TMS320F280023C , TMS320F280025 , TMS320F280025-Q1 , TMS320F280025C , TMS320F280025C-Q1 , TMS320F280040-Q1 , TMS320F280040C-Q1 , TMS320F280041 , TMS320F280041-Q1 , TMS320F280041C , TMS320F280041C-Q1 , TMS320F280045 , TMS320F280048-Q1 , TMS320F280048C-Q1 , TMS320F280049 , TMS320F280049-Q1 , TMS320F280049C , TMS320F280049C-Q1 , TMS320F28384D , TMS320F28384D-Q1 , TMS320F28384S , TMS320F28384S-Q1 , TMS320F28386D , TMS320F28386D-Q1 , TMS320F28386S , TMS320F28386S-Q1 , TMS320F28388D , TMS320F28388S , TMS320F28P650DH , TMS320F28P650DK , TMS320F28P650SH , TMS320F28P650SK , TMS320F28P659DH-Q1 , TMS320F28P659DK-Q1 , TMS320F28P659SH-Q1
HRPWM extends the time resolution capabilities of the conventionally derived digital PWM by using micro-edge positioner (MEP) technology. MEP logic is capable of positioning an edge very finely by subdividing one system clock of conventional PWM generator and provides accuracy on order of picoseconds. The conventional ePWM module does not offer sufficient resolution at high frequencies and that’s where HRPWM can really differentiate if used as an encoding unit as the following system aims to establish low latency and high resolution data transfer. For more details on HRPWM, see the TMS320F2838x Microcontrollers With Connectivity Manager Data Sheet and the TMS320F2838x Microcontrollers Technical Reference Manual.
The function of the encoding unit is to vary the PWM pulse width proportionally to the analog input. This is realized by configuring ePWM to provide conventional PWM of desired frequency and then programming HRPWM MEP to provide precision control on the falling edge (FE), while keeping the rising edge (RE) constant. Also, the MEP is programmed to use the control mode as duty control instead of phase control as the duty parameter of the signal is used for decoding at the receiver. In order to speed-up the encoding routine, auto-conversion mode is enabled in conjunction with scale factor optimization (SFO) library which will automatically calculate the appropriate number of MEP steps represented by the fractional duty cycle and move the falling edge of signal accordingly. The HRPWM programming sequence for the discussed configuration using driverlib APIs is also shown in the code below. For more details, see the Driverlib API User's Guide inside C2000ware. Shadowing (double buffering) is enabled for the registers to prevent any signal distortion by making sure any register update does not affect the current cycle.
//
// Configure MEP edge & control mode for channel A & B, MEP Edge control is
// on falling edge. Control mode is duty control.
//
HRPWM_setMEPEdgeSelect (base, HRPWM_CHANNEL_A, HRPWM_MEP_CTRL_FALLING_EDGE);
HRPWM_setMEPControlMode (base, HRPWM_CHANNEL_A, HRPWM_MEP_DUTY_PERIOD_CTRL);
HRPWM_setMEPEdgeSelect (base, HRPWM_CHANNEL_B, HRPWM_MEP_CTRL_FALLING_EDGE);
HRPWM_setMEPControlMode (base, HRPWM_CHANNEL_B, HRPWM_MEP_DUTY_PERIOD_CTRL);
//
// Enable Automatic Conversion mode
//
HRPWM_enableAutoConversion (base);