Shop OBEX P1 Docs P2 Docs Learn Events
simple IO help please — Parallax Forums

simple IO help please

SeaRaySeaRay Posts: 4
edited 2007-08-04 10:09 in Propeller 1

I am just·starting out with the·propeller and I desperately need some help if anyone would be so kind.
·
I am trying to take a +3v or +5v pused·signal in and trigger an output that is -3v or -5v (see theoretic diagram).
·
This is something that I would normally do with a NPN transistor but it would be fun to do with Parallax products due to some advanced features I can add later...
·
(DIAGRAM)

Common +5v
····································································|······················································· |
Simple +5v pulsed signal 1
à|·PROP |
à---- (-5v )
Device input 1
Simple +5v pulsed signal 2
à |PROP |
à
(-5v )
Device input 2
Simple +5v pulsed signal 3
à |PROP |
à
(-5v )
Device input 3
Simple +5v pulsed signal 4
à |PROP |
à
(-5v )
Device input 4
Simple +5v pulsed signal 5
à |PROP |
à
(-5v )
Device input 5
Simple +5v pulsed signal 6
à |PROP |
à----(-5v )
Device input 6
···································································· |···················· ································· |
···································································· |································· ···················· |
Common Ground

·
·
Can someone please offer a sample of code for the Propeller?
·
·
Thank you

Post Edited (SeaRay) : 8/3/2007 9:28:03 PM GMT

Comments

  • SkogsgurraSkogsgurra Posts: 231
    edited 2007-08-03 21:56
    You need hardware to produce a negative output signal. And a negative power supply. Can't be done in code.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
  • SeaRaySeaRay Posts: 4
    edited 2007-08-03 22:15
    I was worried about that...


    Thanks for your response
  • Mike GreenMike Green Posts: 23,101
    edited 2007-08-03 22:48
    Probably the easiest way to do this is to use an optoisolator and a -5V supply.· The LED side is like any LED.· You'll need roughly a 150 ohm current limiting resistor between a Propeller pin and the anode (triangle)·of the LED and the cathode (bar) of the LED is connected to ground.· On the output side, you'll probably have an NPN transistor in the optoisolator.· You connect the emitter to -5V and the collector to your device.· When you set the Propeller I/O pin direction to a one and the output to a one, the optoisolator will turn on and supply -5V to your device pin.

    Remember that the -5V supply is just an isolated 5V supply with the positive side connected to ground.

    Do you really want switched -5V?· That's unusual these days.




    Post Edited (Mike Green) : 8/3/2007 10:53:07 PM GMT
  • deSilvadeSilva Posts: 2,967
    edited 2007-08-04 10:09
    Inverting voltage just needs a litte bit of electronic sorcery and should not be considered as a "digital" project. Using a pulse output with 30 mA generated by the Propeller will ease things additionally.

    Another very simple and low cost solution is using a MAX 232, which outputs around +6 V as well as - 6V @ 40 mA when connected to 3.3 V. With a $4 rather than a 40 cents investment you can also use a MAX233 which needs no external components at all.. Both switch faster than 100 kHz

    Post Edited (deSilva) : 8/4/2007 10:14:05 AM GMT
Sign In or Register to comment.