how interface ultrasonic sensor with msp430g2553
hi sir/mam,
i want interface ultrasonic sensor with msp430g2553, i have tried in many ways but i am not getting output .i checked the output on cro when object in front of it and i got the output, but i want to calculate the time elapsed between in transmission and reception on echo pulse . so that i can calculte the dostance , but the main problem how to calculate the time . how to use the TAR and TACCTL0 for distance calculation , please help me i am sticking at this point , please help me .
i have attached my program .
thanks
Answers
-
i tried some other way but still i do not get output. when the there is echo i start reading the timer . and stop when the echo is on falling edge.
below i attached the program
0 -
Yogesh, what distances are you trying to measure? It affects the data rate of the timer as it can only hold 16 bits.
The attached should measure up to 34 meters with .5 mm accuracy. I assume pin functions as follows:
Pin Functions
P1.1 - send usonic pulse out
P1.2 - read return pulse
P1.0 - set high when distance > 40cmPete
0