AN1857 Freescale Semiconductor / Motorola, AN1857 Datasheet - Page 42

no-image

AN1857

Manufacturer Part Number
AN1857
Description
A 3-Phase ac Induction Motor Control System Based on the MC68HC908MR32
Manufacturer
Freescale Semiconductor / Motorola
Datasheet
Application Note
PBWC = 0x80;
while (~PBWC & 0x40);
PCTL = 0x30;
MOR = 0x00;
PMOD =PWM_MODULUS; // set up PWM modulus => PWM frequency
/*7.3728MHz Bus Frequency PWM_MODULUS = 0x00e6 gives16kHz PWM */
DEADTM=15;
DISMAP=0xff;
PCTL2 = 0x80;
PCTL1 |= 0xc0;
PWMOUT = 0x00;
PCTL1 |= 0x02;
FCR |= 0x08;
PVAL1 = PWM_MODULUS/2; /* set phase A pwm to 50% */
PVAL3 = PWM_MODULUS/2; /* set phase B pwm to 50% */
PVAL5 = PWM_MODULUS/2; /* set phase C pwm to 50% */
PCTL1 |= 0x20;
PCTL1 |= 0x01;
42
/* setup Motor Control PWM module */
/* (0x60: neg. center PWM mode; cop and LVI enabled) */
/* 2usec deadtime = #15 (for Bus freq. = 7.3728MHz) */
When all modules of the microcontroller are initialized, the code will then
enable the PWM module like this:
/* setup PLL clock */
/* pos. center PWM mode; cop and LVI enabled */
/* enables pwm interrupts */
/* enables PWM */
Freescale Semiconductor, Inc.
For More Information On This Product,
/* when PWM disabled, disable PWM1-6 */
/* PWM interrupt every 4th. pwm loads */
/* disable MCPWM */
/* output port control is PWM generator */
/* set LDOK bit */
/* Flt2 enabled in manual mode */
Go to: www.freescale.com
/* set Auto Bandwidth Control */
/* wait for PLL lock */
/* use PLL clock */
MOTOROLA
AN1857

Related parts for AN1857