alfie.max15
Member level 2
- Joined
- Jan 3, 2013
- Messages
- 47
- Helped
- 0
- Reputation
- 0
- Reaction score
- 0
- Trophy points
- 1,286
- Activity points
- 1,660
I was looking for how to interface the ultrasonic rangefinder with AVR and from a website i found the following steps
Ultrasonic Range Finder Interface.
These modules are designed to be used for microcontroller based applications hence optimized for it. The interface is a single pin called SIG (signal). The MCU is connected to the Ultrasonic Range Finder Module by a single i/o line. The steps required to read distance are :-
1. Microcontroller make the i/o line output. (by using the DDRx Register in AVR or TRISx Register in PIC)
2. The i/o line is made low (this may be the default state of i/o pin)
3. Wait for 10uS
4. Make the i/o line high.
5. Wait for 15uS
6. Make the i/o line low
7. Wait for 20uS
8. Now make it input (by using the DDRx Register in AVR or TRISx Register in PIC)
9. Module will keep it low. Wait till it is low, as soon as it becomes high start the timer.
10. After that wait till it is high, as soon as it becomes low copy the timer value and stop the timer.
11. Finally we have the time required for the wave to go hit the obstacle and come back to the module.
can anyone help me understand this....
why is the i/o lines being toggled between input and output?
why is there change in the wait time?
Ultrasonic Range Finder Interface.
These modules are designed to be used for microcontroller based applications hence optimized for it. The interface is a single pin called SIG (signal). The MCU is connected to the Ultrasonic Range Finder Module by a single i/o line. The steps required to read distance are :-
1. Microcontroller make the i/o line output. (by using the DDRx Register in AVR or TRISx Register in PIC)
2. The i/o line is made low (this may be the default state of i/o pin)
3. Wait for 10uS
4. Make the i/o line high.
5. Wait for 15uS
6. Make the i/o line low
7. Wait for 20uS
8. Now make it input (by using the DDRx Register in AVR or TRISx Register in PIC)
9. Module will keep it low. Wait till it is low, as soon as it becomes high start the timer.
10. After that wait till it is high, as soon as it becomes low copy the timer value and stop the timer.
11. Finally we have the time required for the wave to go hit the obstacle and come back to the module.
can anyone help me understand this....
why is the i/o lines being toggled between input and output?
why is there change in the wait time?