Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

LPC1768 as pulse counter

Status
Not open for further replies.

mariusz7400

Newbie level 1
Joined
Feb 11, 2009
Messages
1
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,287
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:
Code:
//   counter 3
	LPC_SC->PCONP |= (1 << 23);
	LPC_TIM3->TCR = TCR_COUNT_RESET;
	LPC_TIM3->CTCR = 0x101;
	LPC_TIM3->TCR = TCR_COUNT_ENABLE;
And port definition:
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
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
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top