I want to count external pulses on my LPC 1768 board using any of the 4 Timer/Counters. I am configuring all teh registers but its working in timer mode only but not taking input pulse on one of the capture input. can any body give working code for this.
Regards,
vinay
PINCON->PINSEL3|=(3<<20) // PIN SELECT FOR CAP0.0 TIM0->TCR = 2; //RESET the timer TIM0->CTCR = 1; // CTCR I have configured as counter for CAP0.0 for Timer 0 TIMO->CCR = 0; TIM0->TCR = 1; // Enabling the timer
Counter_Value = TIM0->TC;
i am reading Counter_Value.
by doing this my TC register is counting PCLK instaed of External Clock. is there any mistake in the above code.
Vinay
I'm giving up. It's hopeless. Not being to read a manual or program is one thing, but not being able to understand fundamental requests in English is another...
What part of the instructions on how to post source code didn't you understand?
Does your code look like:
#include <stdio.h> void main(void) { printf("Hello world!\n"); while (1) ; }
"PIN SELECT FOR CAP0.0"
"PIN"? Do your processor have a pin named "PIN"? What was the reason you didn't write P1.26 so it is possible to look at the schematic and know which pin the pulse should be connected to?
Have you verified the state of the CAP0.0 pin? Is it stable or floating? The chip samples the pin on every PCLK to try to figure out if it sees a flank or if the pin istatic high or static low.
hey guys i cant write my hundreds of lines code here.i am just trying to explain the concept.if you dont understand leave it.i dont need any bodys help
"i dont need any bodys help"
<BiteMyLip>
</BiteMyLip>
i dont need any bodys help
You are a top-notch moron, my friend...
Well, you certainly haven't listened to anybody's advice yet!