PSoC and PING)))
cjackel
Posts: 4
I would appreciate any assistance on how to implement
bidirectional single pin I/O with the PSoC microcontroller and PING))) sensor.
I have read the PING))) data sheet but there is nothing specific to the
PSoC microcontroller.
I realize I have to send a TTL pulse from the PSoC to the PING, and then
measure the return pulse from the PING in order to calculate the distance
sensed by the PING.
How is this done with the PSoC ? I know it will involve an interrupt routine
and timer, but I was hoping someone has already implemented the code.
Thank you.
-Chuck
bidirectional single pin I/O with the PSoC microcontroller and PING))) sensor.
I have read the PING))) data sheet but there is nothing specific to the
PSoC microcontroller.
I realize I have to send a TTL pulse from the PSoC to the PING, and then
measure the return pulse from the PING in order to calculate the distance
sensed by the PING.
How is this done with the PSoC ? I know it will involve an interrupt routine
and timer, but I was hoping someone has already implemented the code.
Thank you.
-Chuck
Comments
I need a quick solution that at least shows the output signal from the PING))).
How would I connect the PING))) to an o-scope since the signal connection
is both an input and output?
Would connecting the scope to the terminals on the back of the PING))) board where
the two sensors are soldered to the PCB bypass the control circuitry of the PING)))
and allow me to view the signal directly?
Thanks again.
You might start experimenting by having the PSoC generate one 5us pulse in response to a pushbutton switch closure then 500us later set the I/O pin to input mode. A single 5us pulse shouldn't be hard to do, leaving the I/O pin in input mode. You can see the response of the PING on the scope and play with putting your hand or other barrier in front to see what happens. Note that the PING has an LED that will flash when it sees the pulse from the PSoC.
Maybe I'm misunderstanding the datasheet, but does the PING))) need a pulse from the PSoC
every time a distance needs to be measured?
Or is the start pulse from the PSoC a one-time only event that simply starts the PING))) ?
The PING))) uses the 5us pulse to start the overall timing. It initiates the ultrasonic pulse being transmitted. The rest of the timing for a sequence is laid out graphically in the datasheet. The transmitter is turned on for about 200us as shown. Somewhere during that time, the PING's data line is brought high. Shortly after that, the sound pulse ends and the PING's receiver is enabled. When the returning echo is detected by the receiver, the data line is brought low and everything is reset for the next cycle. There's a minimum 200us delay from the end of the PING's response to the next start pulse and there's a timeout on the receiver of about 18.5ms. All of this is in the datasheet.
Thanks.