LPC2148 PWM5 läuft nicht

Gast #600193
Lesenswert?
• ▲
▼
Keine Ahnung wiso die PWM5 nicht läuft.
1
  PINSEL0 &= ~(2 << (10));  //clear bits related to P0.21
2
  PINSEL0 |=  (1 << (10));  //connect signal PWM5 to P0.21 (second alternative function)
3
   
4
  PWMPR  = 0x0000;          //set prescale to 0
5
  PWMMCR = 0x0002;          //counter resets on MR0 match (period time)
6
  
7
  PWMMR0 = 5000;   //MR0 = period cycle time
8
  PWMMR5 = 2500;   //MR5 = duty cycle control
9
  
10
  PWMLER |= (1<<0)|(1<<5); //latch new values for MR0 and MR5
11
  
12
  PWMPCR &= ~(1<<5);
13
  PWMPCR |= (1<<13);
14
 
15
  PWMTCR = 0x09;                   //enable PWM and Counter

danke

Antwort schreiben

Bitte melde dich an, um einen Beitrag zu schreiben.

oder

Mit Google-Account einloggen

Die Registrierung ist kostenlos und dauert nur eine Minute.

Jetzt registrieren