Content originally posted in LPCWare by alex-jhon on Mon Aug 03 00:13:38 MST 2015
Hello,
Presently I'm working on LPC1114FBD48 pin micro controller.
I need to generate the different frequencies at a time using timer of match register. Now I'm getting 0.1HZ using MATO register
suppose I need to generate 1HZ frequency simultaneously how to do it?????
below is my code part.
please help us to complete the task.
int main(void)
{
SystemInit();
LPC_SYSCON->SYSAHBCLKCTRL |= (1<<16) | (1<<6) | (1<<8);
// clock enable for GPIO,IOCON and timer 16 bit.
LPC_IOCON->PIO1_9 |= (1 << 0); // Pin no 17 = CT16B1_MAT0(checking out put )
LPC_TMR16B1 ->MR0 = 3500; //11200; // 50% Duty Cycle
LPC_TMR16B1->PR = 131100; //262000;//17000;
LPC_TMR16B1->MR3 = 7000;//22900;; // Cycle Length
LPC_TMR16B1 ->MCR |= (1 << 10); // TC reset on MR3 Match
LPC_TMR16B1 ->PWMC |= (1 << 0); // PWM Mode channel zero fro CT16B1.
LPC_TMR16B1 ->TCR |= (1 << 0); // timer control
}
Thanks in Advance
alex-jhon