[an error occurred while processing this directive]
|
Взял пример для LPC21xx
там иницифлизация ШИМ имеет след вид:
{ VICVectAddr8 = (unsigned)PWM0_isr; //Set the PWM ISR vector address
VICVectCntl8 = 0x00000028; //Set channel
VICIntEnable = 0x00000100; //Enable the interrupt
PINSEL0 |= 0x00028000; //Enable pin 0.7 as PWM2
PWMPR = 0x00000001; //Load prescaler
PWMPCR = 0x00000404; //PWM channel 2 double edge control, output enabled
PWMMCR = 0x00000003; //On match with timer reset the counter
PWMMR0 = 0x000000FF; //set cycle rate to sixteen ticks
PWMMR1 = 0x00000080; //set rising edge of PWM2 to 2 ticks
PWMMR2 = 0x00000080; //set falling edge of PWM2 to 8 ticks
PWMLER = 0x00000007; //enable shadow latch for match 0 - 2
PWMEMR = 0x00000280; //Match 1 and Match 2 outputs set high
PWMTCR = 0x00000002; //Reset counter and prescaler
PWMTCR = 0x00000009; //enable counter and PWM, release counter from reset
PWMLER = 0x00000006;
}
не нашел регистр PWMEMR в мануале LPC2148. Есть ли он и нужен ли данный регистр для работы ШИМа?
E-mail: info@telesys.ru