Laser Ping operation question

Not sure I am doing this right, but here is what I am driving a laserPing for testing:
pub Pulse_Laser

    dira[12] := 1
    outa[12] := 0
    repeat
        outa[12] := 1
        outa[12] := 0
        dira[12] := 0
        waitcnt(clkfreq/1375 + cnt)
' for something to do
        waitcnt(clkfreq/5 + cnt)
        dira[12] := 1
This gives me a 7us pulse with a .5 second repetition rate. The 1375 value (yes, I know evil magic number. but this is only for testing) gives about a 750us delay after which I should see a pulse out of the laserPing.
the for something to do is a place holder for whatever I will do to measure the pulse width. No pulse comes back. Even switched to input so that nothing could be loading the output pin. Same behavior at 3 or 5V

If I plug in a standard PING module, then I see the pulse followed by another which varies with object to ping distance as expected.

Thanks,

Frank

Hopefully someone will say try X and here is what you did wrong rather than a non-functional laserPing.

Comments

  • The laser ping doesn't work the same as the PING module. It's serial in nature and requires configuration.

    Mike
  • iseries wrote: »
    The laser ping doesn't work the same as the PING module. It's serial in nature and requires configuration.

    Mike

    It works both ways. It does work like a normal Ping AND it can use a serial connection.
  • That is what I thought from the first half of the data sheet. If I jumper for serial, it seems from the same sheet that it should start streaming readings continuously and if it doesn't then it's likely defective.

    The timing i am getting was observed using an AD2 in scope mode.

    Thx
  • If I jumper for serial, it seems from the same sheet that it should start streaming readings continuously and if it doesn't then it's likely defective.

    FWIW, I jumpered mine for continuous serial and it works fine.

  • Quick guess... Powercycle after applying the jumper to get to serial mode?

  • Yep, Jumpered and no serial pulses. Device looks like it is non-functional.
  • @frank freedman

    I bought one of these recently and initially tried getting it working and failed, without noticing on the product page that it is supposed to be drop-in compatible with the Ultrasonic PING. I know from above you're aware it's compatible (not when in serial mode), but I was curious if you've tried any existing objects for the original ultrasonic ping? The driver/demo included with the PropTool library worked straight away for me.

    Cheers
  • Is maybe a pull-up/pull-down missing? Does a scope show the pin transitioning properly when driven?
  • avsa242 wrote: »
    The driver/demo included with the PropTool library worked straight away for me.

    Mine also worked fine with Ping code before I modified it for continuous serial output.

  • @JRoark, did I miss something in the docs? No mention of a pullup needed.


    @Duane Degn starting to try the demo you mentioned, but may have to butcher it up a bit to use serial port rather than serial LCD. Still think it's dead though.
  • frank freedmanfrank freedman Posts: 1,729
    edited 2020-10-19 - 04:30:44
    Yep, Still dead. Will need to find out how to replace it. No silly strings shooter for your tonight!!!
  • Have you tried the demo code Duane mentioned with an unmodified LaserPing (ie. remove any jumper/etc... back to default state).

    I think this could be the code: https://www.parallax.com/downloads/ping-ultrasonic-distance-sensor-propeller-code

    Wire this up as explained in the comments at the top of the code file. The two LEDs could be left out for testing, just the LaserPing connections needed; Signal, 3.3V and Ground.

    This should work for a Ping or LaserPing. And you should be able to drop either into the same circuit and see the output on the parallax serial terminal set to 9600 baud.
    Make sure you power off/on the ping/laserping and propeller board after changing the device. (probably not critical for ping, but laserping only decides it's mode at power-up AFAIK, so if you don't see the output you expect, powercycle everything!)

    If the LaserPing fails to output in default PWM mode using unmodified Parallax code sample then it could be faulty- and in that case I'd suggest you contact support@parallax.com with your sales order number to request a replacement. I'm flagging your issue over to the support desk in-case you contact them, so they'll be aware of the details and save you time re-explaining!

  • Tried it. Ping works, laserping does not. Device is really dead. Now to find out where to send the DOA part.
Sign In or Register to comment.