Configuating the double sample and double update in every FOC period by using etpu module on MPC5777

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Configuating the double sample and double update in every FOC period by using etpu module on MPC5777

426 Views
Harry0001
Contributor II

Hello!I am configuating the double sample and double update in every FOC period by using etpu module,and i set the pwmm_config structure as FS_ETPU_PWMM_FM1_FRAME_AND_CENTER_UPDATE to realize the two updating position. Beyone that,i also set the as_config_t structure of etpu module to  FS_ETPU_AS_FM1_CENTER_PULSE_ON to realize the two triggle time, After that i captured the picture of the oscilloscope about the AS signal and the PWMH signal of V phase of the motor control,and compared them before and after the above setting,however i did not found the correct result,i also attached the two pictures to show that. Please help me to find how to configure the etpu correctly.thanks!Before-PWM及AS均为边沿对齐.pngAfter-pwm及AS均为中心及边沿对齐.png

0 Kudos
1 Reply

399 Views
Yongbing_Nan
NXP Employee
NXP Employee

Hi,

If you want to implement double sample, please trying the following AS configuration. Focus on the black bold section below


struct as_config_t as_config =
{
0, /* start_offset */
0, /* period */
USEC2TCR1(5), /* pulse_width */
FS_ETPU_AS_FM0_FRAME_PULSE_ON | FS_ETPU_AS_FM1_CENTER_PULSE_ON, /* pulse_selection */
0, /* pulse_adjustment_frame */
USEC2TCR1(5), /* pulse_adjustment_center */
FS_ETPU_AS_IRQ_FRAME_PULSE_START, /* irq_dma_options */
FS_ETPU_AS_LINK_FRAME_PULSE_END, /* link_options */
0, /* link_chans_frame_start */
...

...
};

0 Kudos