[ARM] input capture in arm7

Status
Not open for further replies.

lalit_sharma

Newbie level 1
Joined
Feb 4, 2015
Messages
1
Helped
0
Reputation
0
Reaction score
0
Trophy points
1
Visit site
Activity points
5
hi I'm using LPC2148 and trying to capture input.
echo signal of hc-sr04 needs to be calculated can anyone guide me...
 

I am still learning LPC2148 hence can't give you code.

Process is.

make trig pin high
then a delay of 10 us
then make trig pin low

clear 16 bit timer

wait till echo pin goes high

when echo pin goes high start timer

wait till echo pin goes low

when echo pin goes low stop timer

use timer value and do the calculation to get distance

additional:

if timer overflows before echo goes low then increment a counter.

if counter is 1 add 65535 to timer value before calculating distance
if counter is 2 add 65535 * 2 to timer value before calculating the distance.

additionally use US-020 module which can measure 700 cms.
 
Status
Not open for further replies.

Similar threads

Cookies are required to use this site. You must accept them to continue using the site. Learn more…