Shop OBEX P1 Docs P2 Docs Learn Events
jm_freqinDemo.spin — Parallax Forums

jm_freqinDemo.spin

yarisboyyarisboy Posts: 245
edited 2010-08-14 08:21 in Propeller 1
I've loaded subject object on my Propeller and it does indeed output a square wave on pin zero. I haven't been able to get the serial terminal to display the frequency yet. The other serial exercises in the PE labs book work fine. Is there a communications parameter bug in this object set? Once I've fixed the serial terminal interface I need to count the frequency on pin zero I'm generating on a separate Propeller that is also xtal controlled. I'm looking at results on an oscilloscope. I'll have to comment out the signal generation code to do this but am not sure what I'll need to add to read pin 0. I have an opto isolation between my two Propeller boards and magnetic isolation between their respective DC sources.

Comments

  • StefanL38StefanL38 Posts: 2,292
    edited 2010-08-08 12:42
    I using the demo from 10.07.2009 in the attachment and it is working fine.

    The Output to PST.EXE is just ONE line and a repeated clearscreen

    so you see just a single line.
    The demo is tricky. A counter is set up to toggle PIN 0. While the freq-in-object is measuring this frequency.

    For your other questions. Do your homework and make suggestions what YOU think you have to change in the code

    best regards

    Stefan
  • JonnyMacJonnyMac Posts: 9,208
    edited 2010-08-08 16:12
    Well, I am human so I suppose there *could* have been a problem, but I just downloaded the code from ObEx and found -- as Stefan did -- that it works just fine.

    As Stefan points out, it's a tiny bit tricky; the period timer is launched into its own cog with a pin assignment and then we create pulses on that pin in our "foreground cog" (main method in the Spin application).

    If you have an external pulse coming in the make sure you remove the lines between

    term.tx(CLS)

    and

    repeat

    ... and, by all means, make sure that your foreground code is not setting the frequency input pin to output mode.
  • yarisboyyarisboy Posts: 245
    edited 2010-08-14 08:21
    Thanks for the feed back. Using other Propellers on my bench I find the code works just fine. I suspect the one in my breadboard has failed due to an ESD event. Of the three Props I bought in that batch, one had a dead P6 out of the box. The other two have failed due to the slings and arrows of outrageous bench experiments. At $8 a pop that's still a smokin deal (no pun intended). Using JonnyMac's edit recommendation I'm getting correct results on my laptop for any given tachometer signal in.
Sign In or Register to comment.