21.01.2014 Views

3.22EjemploDRM007 Co..

3.22EjemploDRM007 Co..

3.22EjemploDRM007 Co..

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Source <strong>Co</strong>de<br />

PVAL3 = _newPWM;<br />

PVAL4 = PVAL3 - DEADTIME;<br />

PVAL5 = newPWM;<br />

PVAL6 = PVAL5 - DEADTIME;<br />

#endif<br />

}<br />

else if (TempHalls == (HALL_A | HALL_B))<br />

{<br />

#ifdef MOS_3_COM<br />

PVAL1 = _newPWM;<br />

PVAL3 = _newPWM;<br />

PVAL5 = newPWM;<br />

#endif<br />

#ifdef MOS_2_COM<br />

PVAL1 = _newPWM;<br />

PVAL2 = PVAL1 - DEADTIME;<br />

PVAL3 = PWMON;<br />

PVAL4 = PWMOFF;<br />

}<br />

}<br />

PVAL5 = newPWM;<br />

PVAL6 = PVAL5 - DEADTIME;<br />

#endif<br />

PCTL1 |= LDOK;<br />

#ifdef MOS_2_COM<br />

newPWM = backupnewPWM;<br />

#endif<br />

}<br />

return;<br />

/*****************************************************************************\<br />

* void init_PWMMC (void):Initialization of the PWM module is implemented *<br />

* in this subrouine and the frequency is set to<br />

*<br />

* 15.625 kHz. *<br />

* *<br />

* Parameters: None. *<br />

*<br />

* Return: None. *<br />

\*****************************************************************************/<br />

DRM007<br />

BLDC Motor <strong>Co</strong>ntrol Board for Industrial and Appliance Applications<br />

142 Source <strong>Co</strong>de MOTOROLA

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!