Content originally posted in LPCWare by tungsys on Tue Jan 03 23:47:05 MST 2012
Hi,
Can I use one timer (CT16B1) to generate 2 PWM at the same time.
According to User Manual. Timer CT16B1_MAT[1:0] has two out put such as MAT0 and MAT1 and can be configured independently.
But after I try , only either MAT0 or MAT1 can out put at a time. Cannot generate 2 PWM at the same time.
Below is my code:
==================================================
volatile uint32_t period = 1000; //48Khz PWM frequency
/* Main Program */
int main (void) {
/* Initialize the PWM in timer16_1 enabling match1 output */
init_timer16PWM(1, period, MATCH1, 0);
//init_timer16PWM(1, period, MATCH0, 0);
setMatch_timer16PWM (1, 1, period/8); // PIO 1.10
//setMatch_timer16PWM (1, 0, period/4); // PIO 1.9
enable_timer16(1);
}
=====================================================