下面是F2812XOWM.H:
/*-----------------------------------------------------------------------------
Define the structure of the PWM Driver Object
-----------------------------------------------------------------------------*/
typedef struct {
Uint16 PeriodMax; // Parameter: PWM Half-Period in CPU clock cycles (Q0)
int16 MfuncPeriod; // Input: Period scaler (Q15)
int16 MfuncC1; // Input: PWM 1&2 Duty cycle ratio (Q15)
int16 MfuncC2; // Input: PWM 3&4 Duty cycle ratio (Q15)
int16 MfuncC3; // Input: PWM 5&6 Duty cycle ratio (Q15)
void (*init)(); // Pointer to the init function
void (*update)(); // Pointer to the update function
} PWMGEN ;
我的问题是:
1、为什么PeriodMax的值为什么是“PWM Half-Period in CPU clock cycles (Q0)”?
PS:在控制交流电机的例程ACI3_1.C中,对PeriodMax赋值是采用下面的方式:
/ / Initialize PWM module
pwm1.PeriodMax = SYSTEM_FREQUENCY*1000000*T/2; // Perscaler X1 (T1), ISR period = T x 1
pwm1.init(&pwm1);
为什么是系统频率参与定时器T1的周期寄存器值得计算?不应该是系统时钟经过高速时钟预定标和EV的时钟预定标进行分频后的时钟,参与计算吗?
2、MfuncPeriod这个变量的具体作用是什么呢?