Hello,
I have a problem with PWM on LPC2103 P0.7 connected to MAT2.0. PWM signal although works fine on P0.8 connected to MAT2.1. I'm using Keil 4.12 eval. If I use WinARM (GNU GCC) everything works fine (PWM on both ports - P0.7 or P0.8). Here is the sample code tested on MCB2103 and simulator with logic analyzer.
If anyone has some idea I'd be thankful :)
#include <LPC2103.H> int main(void) { PINSEL0 |= 0x00028000; T2TCR = 1<<1; // Reset TC and PC, disable timer T2PR = 0; // Prescaling T2TC = 0; T2MCR = 0x0400; // Reset on MR3 match T2PWMCON = 0x0000000b; // Enable PWMs T2EMR = 0x3<<4 | 0x3<<6; // Enable MAT2.0, MAT2.1 and set toggle mode // Setup PWM parameters T2MR3 = 255; // Period duration T2MR1 = 127; // Pulse width T2MR0 = 127; // Pulse width T2TCR = 1<<0; // Enable counter while(1); }