how interface ultrasonic sensor with msp430g2553

Altair Forum User
Altair Forum User
Altair Employee
edited November 2020 in Community Q&A

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

Unable to find an attachment - read this blog

Answers

  • Altair Forum User
    Altair Forum User
    Altair Employee
    edited November 2020

    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

    Unable to find an attachment - read this blog

  • Altair Forum User
    Altair Forum User
    Altair Employee
    edited November 2020

    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 > 40cm

    Pete

    Unable to find an attachment - read this blog