Shop OBEX P1 Docs P2 Docs Learn Events
Sending Info from one Pin to another — Parallax Forums

Sending Info from one Pin to another

PalastinePalastine Posts: 12
edited 2008-04-21 15:09 in Propeller 1
Is there a command that take the output from one·pin in the propeller chip·and send to another pin in the propeller chip·to act as an output

for example i want to·take the·input from pin #1 and send it to pin 7 to produce the output.

Please help, thanks

eyes.gif

Comments

  • stevenmess2004stevenmess2004 Posts: 1,102
    edited 2008-04-19 07:56
    There isn't a single command to do this. In spin you could do something like this
    OUTA[noparse][[/noparse]outputPin]:=INA[noparse][[/noparse]inputPin]
    


    In assembler you would so something like this
    test inMask,INA wz
    muxnz OUTA,outMask
    
    inMask long |<inputPin
    outMask long |<outputPin
    
  • PalastinePalastine Posts: 12
    edited 2008-04-19 10:20
    I will try that.

    Thanks
  • Beau SchwabeBeau Schwabe Posts: 6,559
    edited 2008-04-20 04:52
    Palastine,

    If you wanted to get tricky and you can work with the signal being inverted, you could do something using one of the Counters.

        DIRA[noparse][[/noparse]Bpin]~~                                        'Make BPin an Output
        CTRA :=  %01001 <<26 | Bpin <<9 | Apin              'Setup counter for POS detector with Feedback mode
        FRQA := 1                                           'Start Counter
    
    

    All you have to do is run this once, and as long as the COG is kept alive doing other "stuff" the Apin will read the input value of the pin you assign, while the Bpin will reflect the INVERTED result of the value read·by the Apin.

    ·

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

    IC Layout Engineer
    Parallax, Inc.
  • PalastinePalastine Posts: 12
    edited 2008-04-21 13:26
    Thank you, it really helped smile.gif
  • Ken PetersonKen Peterson Posts: 806
    edited 2008-04-21 13:49
    Palastine: Is this just an exercise in Prop programming, or are you trying to solve a real problem by doing this? Because it seems you are essentially programming the Prop to act as a piece of wire. Why wouldn't you connect whatever is on output pin to the input pin instead?

    I like·Beau's suggestion for another·reason:· This would really be useful if I needed an inverter or two and didn't want to add an inverter·chip or transistors to my design just for one or two inverters.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔


    The more I know, the more I know I don't know.· Is this what they call Wisdom?

    Post Edited (Ken Peterson) : 4/21/2008 1:55:19 PM GMT
  • hippyhippy Posts: 1,981
    edited 2008-04-21 15:09
    I had to build an InPin -> map -> OutPin router and the Propeller could do that brilliantly; 16 pins could be routed at over a 4M samples per second rate at 80MHz ( as could other fast micros ) but a single Cog can do the same at 600ksps leaving 'seven full-speed micros free for other purposes'. This Propeller thing never ceases to impress me.
Sign In or Register to comment.