Shop OBEX P1 Docs P2 Docs Learn Events
Can the prop act as an analog switch?? — Parallax Forums

Can the prop act as an analog switch??

w4fejw4fej Posts: 264
edited 2010-10-01 12:42 in Propeller 1
I have an application where I need to switch 2 way radio mic's from one radio to another. I know I can use "real" analog switches but if the Prop can do the deal without any support chips that would be great. I will (want) to switch one mic to 4 radios and also switch reciever audio as well.

What do you think? (well, no, bad question, lol. Can it be done??)

MIke B.

Comments

  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2010-09-20 16:48
    There are no analog switches built into the Prop pins, so the strict answer to your question is, "No." However, by using the Prop's sigma-delta ADC capability, along with its DUTY mode output, you could set one up and program it to perform the mic/spkr switching you're looking for.

    -Phil
  • Toby SeckshundToby Seckshund Posts: 2,027
    edited 2010-09-21 01:33
    If the pins were in INPUT mode then they provide a very high impedance, if they are in OUTPUT mode then they would be very low impedance. So if the wanted audio was not dragged down by a series resistor and an OUTPUT pin then that one would be sort of be selected. More a case of deselecting the unwanted other three.

    This would only work at audio levels within the 0 -> 3.3 Volts range and at resonably high impedances ie >100 Ohms or so, this would still leave you with some external hardware, even if it counts the resistors etc. Some buffering would then make the whole project better but get closer to the hardware you were hoping to avoid.
  • TubularTubular Posts: 4,726
    edited 2010-09-21 04:50
    Along what Toby's saying, for your particular application you might be able to make a kind of Tee attenuator

    Input A >--Resistor--P0--Resistor--Output node--Resistor--P1--Resistor--< input B

    To select input A, float (input) P0 and output Low (ground) P1. An attenuated Input A is present at the output node

    To select input B, float (input) P1 and output Low (ground) P0. Input B is present at the output node.

    You can of course mute both by outputting low to both pins. You might need to buffer the output node and made up for the lost gain
  • KaosKiddKaosKidd Posts: 296
    edited 2010-09-21 12:18
    Tubular wrote: »
    Along what Toby's saying, for your particular application you might be able to make a kind of Tee attenuator

    Input A >--Resistor--P0--Resistor--Output node--Resistor--P1--Resistor--< input B

    To select input A, float (input) P0 and output Low (ground) P1. An attenuated Input A is present at the output node

    To select input B, float (input) P1 and output Low (ground) P0. Input B is present at the output node.

    You can of course mute both by outputting low to both pins. You might need to buffer the output node and made up for the lost gain


    Just what do you mean by Float?
    A pin can either be INPUT or OUTPUT, and EITHER HIGH or LOW.

    Just asking for my own ref here. :)
    KK
  • Toby SeckshundToby Seckshund Posts: 2,027
    edited 2010-09-21 13:15
    When the pin is in INPUT mode it will just follow the input voltage ie "float up and down" with it, as a high impedance . Obviously the Prop would only decide if it was higher or lower than the half way point, without affecting the loading on that input. Some threads refer to the pin being in tri-state mode

    If the pin was in OUTPUT mode then it would be nailed high or low, with an extremely low impedance.

    We are used to using the pin outs as digital only, but they can be used as non-loading inputs and heavily loading outputs to audio signals, as long as the signals are biased correctly and within the 0-3.3V limits.

    I haven,t done this with a Prop but I have done simular things with AVRs so it should be exactly the same.

    (sorry to swear, again)
  • w4fejw4fej Posts: 264
    edited 2010-09-21 15:08
    All interesting replys. I kinda had the feeling it might get "wormy" that way. I have a bunch of "logic driven, latching relays" (DPDT) that I might as well use.. With 6 og them I can accomplish what needs doing. Mic and PTT on each relay plus I want to mute ALL audio when ANY radio transmits to eliminate the "cross talk" I get now and hence the reason for the project in the first place..

    Thanks to all.

    Mike B. - W4FEJ
  • Toby SeckshundToby Seckshund Posts: 2,027
    edited 2010-09-21 15:54
    Being old, I have a great affinity to copper and iron. Relays give you the wonderful bonus of, an almost, isolated closure/opening, along with a low transmission loss.
  • w4fejw4fej Posts: 264
    edited 2010-09-22 02:33
    Being old, I have a great affinity to copper and iron. Relays give you the wonderful bonus of, an almost, isolated closure/opening, along with a low transmission loss.

    Sing it Brother!! I agree with you. I too am old, I understand relays.. lol... I got 10 of these relays that are 5 volts "logic controlled" (ie: gates) for $5.00 and two of them fit nicely in a 20 pin wire wrap IC socket.

    Mike B. - W4FEJ
  • Toby SeckshundToby Seckshund Posts: 2,027
    edited 2010-09-22 07:01
    Too often I get the feeling that the 1,000 transistors in a chip I am about to use could be replaced by a few lumps of copper and iron. I came up through the latter days of valves, now everybody wants them back again (and pay a fortune for it too)
  • KaosKiddKaosKidd Posts: 296
    edited 2010-10-01 10:53
    When the pin is in INPUT mode it will just follow the input voltage ie "float up and down" with it, as a high impedance . Obviously the Prop would only decide if it was higher or lower than the half way point, without affecting the loading on that input. Some threads refer to the pin being in tri-state mode

    If the pin was in OUTPUT mode then it would be nailed high or low, with an extremely low impedance.

    We are used to using the pin outs as digital only, but they can be used as non-loading inputs and heavily loading outputs to audio signals, as long as the signals are biased correctly and within the 0-3.3V limits.

    I haven,t done this with a Prop but I have done simular things with AVRs so it should be exactly the same.

    (sorry to swear, again)

    Thanks for clearing that up for me...
    This is something I need to know for my keyboard project.
    KK
    PS:It took me for ever to find this subject and your reply! Sorry it took so long to get back to you...
  • Toby SeckshundToby Seckshund Posts: 2,027
    edited 2010-10-01 12:42
    No problem. The main thing to remember is that this is only true for voltages that fall between 0 Volts and 3.3 Volts and so the signals must be biased and contained within these limits.

    There would be some extra range, before clipping, by the input protection diode. It would be best not to trouble these too much.
Sign In or Register to comment.