Shop OBEX P1 Docs P2 Docs Learn Events
Is it possible to pass through a signal unprocessed ? — Parallax Forums

Is it possible to pass through a signal unprocessed ?

jbalatjbalat Posts: 96
edited 2009-08-27 00:17 in BASIC Stamp
Ok here is the scenerio...

I have a square wave coming in on pin7 at frequency 1 which I read with pulsin

I then output it via the pwmpal on pin12 at a slightly reduced frequency via Pin12

Because of the speed of the bs2p once the input frequency gets too high (ie above 200Hz) there is too much lag..

At that point and above I just wanted to pass the original wave out from pin7 through to pin12 without processing ?

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2009-08-26 00:08
    You can't pass the original wave from one pin to another without at least a little processing and the delays that go with that. One minimal amount of processing could be:
    outputLoop:
    OUT12 = IN7
    GOTO outputLoop
    
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2009-08-26 01:27
    Another option would be to connect a 1K resistor between the two pins. When you want pass-through, just change P12 to an input.

    -Phil
  • Tracy AllenTracy Allen Posts: 6,662
    edited 2009-08-26 03:34
    If you have a BS2p (or pe or px), there are POLLxxx commands that can link two pins in a way that acts like a pass-thru. Once it is set up, it does not require further program intervention. It is not perfect. There are still delays and the possibility that it will miss fire, depending on what the rest of the program is doing. For example, it won't work if your program has long PAUSE statements. Phil's solution is probably the best bet.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Tracy Allen
    www.emesystems.com
  • jbalatjbalat Posts: 96
    edited 2009-08-27 00:17
    Will give those suggestions a try.. Thanks for your input !!

    The POLLxx command sounds very intruiging..I'm just trying to think how I can use it to speed up my program.
Sign In or Register to comment.