|
PINSEL0 |= 0x000080; // port0_3 - OUT of PWM
T0MR1 = 0x00000400; //set rising edge of PWM to 1024 ticks
T0EMR = 0x0000090; //Match0_0 -"fail" Match0_1 -"rise"
T0MR0 = 0x00000800; // период 2048 ticks
T0MCR = 3; // Interrupt and Reset on MR0
T0TCR = 1; // Timer0 Enable
VICVectAddr0 = (unsigned long)tc0; // set interrupt vector in 0
VICVectCntl0 = 0x20 | 4; // use it for Timer 0 Interrupt
VICIntEnable = 0x00000010; // Enable Timer0 Interrupt