Shop OBEX P1 Docs P2 Docs Learn Events
"Ping" @ 80mhz what's my problem? — Parallax Forums

"Ping" @ 80mhz what's my problem?

Scott EstesScott Estes Posts: 10
edited 2008-10-28 20:52 in Propeller 1
Has anybody tried running the ping.spin at 80mhz?· I put the logic into a repeat loop and set it up to run on cog1.· VGA is running on cog 0.· The ping runs for a round or two and then hangs in a waitpne.· It will run longer if I keep waving my hand in front of the ping·which keeps it from reaching the 20ms timeout.

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2008-10-28 19:37
    80 MHz is the normal speed for most Propeller programs. BoeBotBasic uses a modified version of ping.spin for its PING))) support and works fine at 80MHz. There must be something that you've changed that has "broken" things. You'll need to post your code as an attachment to a message for more help.
  • Beau SchwabeBeau Schwabe Posts: 6,560
    edited 2008-10-28 19:40
    Scott Estes,

    Please use the "File-->Archive-->Project..." from within the Propeller IDE and post your code so that we can see what your code is doing.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Beau Schwabe

    IC Layout Engineer
    Parallax, Inc.
  • Scott EstesScott Estes Posts: 10
    edited 2008-10-28 19:46
    Here is the code.· The things I added are the repeat and

    ·_clkmode = xtal1 + pll16x···· '80 MHZ
    ·_xinfreq = 5_000_000

    Thinking it was a timing issue I rewrote this code in assembly.· Instead of waitpne I used test and if_e, if_ne.· The outcome is the same.· If you can get this to work.· I will assume it is hardware.
  • Mike GreenMike Green Posts: 23,101
    edited 2008-10-28 20:01
    Ping.spin is written to be an object which is incorporated into some other program. It will not work by itself. Look at the Ping_demo.spin program which uses ping.spin to actually interface to the PING))).

    It looks like you need to go through the first part of the Propeller Manual to see how programs are put together. Also consider going through some of the Propeller Education Kit tutorials.
  • Scott EstesScott Estes Posts: 10
    edited 2008-10-28 20:06
    Comment out _clkmode = xtal1 + pll16x and _xinfreq = 5_000_000 and press F10. It does work by itself. In addition, I have used it as demonstrated with the same outcome.
  • Scott EstesScott Estes Posts: 10
    edited 2008-10-28 20:42
    Beau,
    Would you be able to tell me why the file I sent will not run stand alone? I assume it works in the demo, but I do not have an LCD display. I can also make it work with some VGA code I have. However, I would like the ping to run in a repeat loop so I can do some filtering on the signal. At some point I will merge the ping into some working VGA code with some other sensors. The ping.spin that I sent does run in stand alone. It just doesn't run at 80mhz.
    Thank You
  • Scott EstesScott Estes Posts: 10
    edited 2008-10-28 20:52
    Beau
    I am not sure why, but I had to add waitcnt(clkfreq / 10 + cnt) at the bottom of the repeat loop. Can you tell me why a wait period is required?
Sign In or Register to comment.