mariusz7400
Newbie level 1
Hi, I have to count pulses by LPC1768. I try to use port P0.24 with function CAP3.1 to driving Timer3 as counter.
Example of timer3 configuration:
And port definition:
And LPC_TIM3->TC not change.
If I configure Timer3 with PCLK as source is OK. When i use P0.24 as input pin is also ok. I can count level changes in main loop. But why not work counting pulses by timer/counter functionality.
Maybe I have to match any register more?
Regards
Example of timer3 configuration:
Code:
// counter 3
LPC_SC->PCONP |= (1 << 23);
LPC_TIM3->TCR = TCR_COUNT_RESET;
LPC_TIM3->CTCR = 0x101;
LPC_TIM3->TCR = TCR_COUNT_ENABLE;
Code:
// LPC_PINCON->PINSEL1 &= ~(1 << 17) | (1 << 16); // set pin P0.24 as GPIO
LPC_PINCON->PINSEL1 |= (1 << 17) | (1 << 16); // set pin P0.24 as CAP3.1
LPC_GPIO0->FIODIR &=~(1<<24); // set pin P0.24 as input
If I configure Timer3 with PCLK as source is OK. When i use P0.24 as input pin is also ok. I can count level changes in main loop. But why not work counting pulses by timer/counter functionality.
Maybe I have to match any register more?
Regards