Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronic 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.

Register Log in

Capture Module in 16f877

Status
Not open for further replies.

bing2005

Junior Member level 2
Joined
Feb 21, 2005
Messages
24
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,486
I want to capture signal from the 40KHz ultrasonic transducer with the capture module.
But, i cannot capture the signal from the ultrasonic transmitter.
The capture part source code is shown as below:
Code:
void capture(void)
{

	if(RC2==0)
	{	
		RB4 = 1;
		CCP1CON	= 0x04;
		TMR1ON	= 0;
	}

	if(RC2==1)
	{
		RB5 = 1;
		CCP1CON	= 0x05;
		TMR1ON	= 1;	
	}

}
I try to capture the falling edge and rising edge then store the time, and use the time to calculate the distance.
Thanks guys!!![/code]
 

Status
Not open for further replies.
Toggle Sidebar

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Top