Shop OBEX P1 Docs P2 Docs Learn Events
Using PROP to control AUDIO SIGNALS via CD4066 QUAD GATE? — Parallax Forums

Using PROP to control AUDIO SIGNALS via CD4066 QUAD GATE?

DavidMDavidM Posts: 626
edited 2007-10-01 14:15 in Propeller 1
HI,

I want to have the propeller switch/mix stereo audio line level signals.

I am using a uMP3 audio player board ( of which the PROPELLER will control via serial), But there is no audio going into the prop.

The AUDIO OUT of The uMP3 Player will be directed to 3 X STEREO OUTPUTS,

1) MAIN AUDIO OUT
2) LEFT HEADPHONE OUTPUT
3) RIGHT HEADPHONE OUTPUT

What I have is 2 lots of 3 buttons on a MEMBRANE KEYPAD for the two headphone outputs that say..

"LEFT" , "STEREO", "RIGHT" for the LEFT HEADPHONE & the same again for the RIGHT HEADPHONE ( there are no controls on the MAIN AUDIO OUT.

When the user presses the "LEFT" button ( of say the LEFT HEADPHONE OUTPUT) , the left audio signal is sent out to BOTH LEFT & RIGHT outputs ( in this case headphone output 1) and the right channel is not used.
If the user presses "STEREO" , the left is sent to the left output and the right is sent to right for normal stereo listening. & finally
If the user presses the "RIGHT" button, the LEFT CHANNEL is not used but the right channel signal is sent to both the LEFT & RIGHT outputs.

So, can I use the CD4066 QUAD GATE to do this? with the propeller controlling the "CONTROL A, B C & D lines" of the 4066 chip?

QUESTIONS..
1) Is it just a matter of setting the CONTROL PINS of the 4066 Chip to HI, to activate them ?
2) Do they need to be pulled low if not so? i.e not floating.
3) I believe I need to use such a gate as the 4066 because I am dealing with AUDIO which is AC Current?
4) If I use TWO 4066 chips that will be 8 I/O lines used, So is there a better way to set the gates with less I/O, (eg Shift register?)

I have attached a schematic to help illustrate this.
Thanks

Dave M.

Comments

  • deSilvadeSilva Posts: 2,967
    edited 2007-10-01 07:53
    4066 can be used. They work into the MHz area...
    - max 25 mA
    - but adding 300 Ohms!

    You could also be interested in 4051 or 4052
  • DavidMDavidM Posts: 626
    edited 2007-10-01 08:24
    HI DeSilva,

    What do you mean by 300ohms??

    Thanks

    Dave M
  • Graham StablerGraham Stabler Posts: 2,507
    edited 2007-10-01 09:36
    The typical on resistance is 270 ohms at Vdd = 5v.

    Search for analogue switch, many manufacturers do them, Maxim especially do some very good ones.

    Graham
  • AribaAriba Posts: 2,685
    edited 2007-10-01 11:39
    I suggest to use the 4052 or 4053 instead of a 4066. They have the advantage of a negative supply voltage, and so the Signal at the switches can be a true AC signal.

    Andy
  • DavidMDavidM Posts: 626
    edited 2007-10-01 11:43
    HI,

    I still don't understand what you guys are saying,

    270 ohms at 5 V = 18 ma??

    Please explain!

    Anyhow, can I run this from a 74HC595 Shift register? I would only need 3 or 4 lines from the prop!

    see attached schematic ( which is incomplete )

    Thanks

    Dave M
  • Peter JakackiPeter Jakacki Posts: 10,193
    edited 2007-10-01 12:33
    A perfect switch would be zero ohms or very close to it. The CMOS switch has some finite resistance when it is turned on and in this case it is around 270R when the chip is powered from +5V. Look at the datasheet under "DC Electrical Characteristics" and find "Ron". No problem here for your application but you would probably need buffer amps on the output to present a low-impedance drive to whatever you may connect to.

    Yes, of course you can run it from shift registers but I don't think you understand the operation of the switch. There is no ABC type thing, you have either end of the switch (IN/OUT and OUT/IN) plus a control line (CONTROL n). A logic low on the control input and the switch is open (actually high-resistance), a logic high on the control input and the switch is closed (actually 270R at VDD=5V).

    *Peter*
  • AribaAriba Posts: 2,685
    edited 2007-10-01 12:36
    Do you want connect the Headphones directly at the CMOS-switches? Or is there a Headphone-Amp after the switches?

    In the fist case: The CMOS switches are not ideal switches, they have a Resistance of 270 Ohm if they are switched ON. Your Headphone has 8 Ohm or perhaps max. 32 Ohms. This can not work.

    In the second case: The CMOS switches works only in the range of the supply voltage (0..3.3V here), but Audio signals are AC signals that swings also in the negativ range. A 4052 can handle this.

    With two 4052 you need only 4 lines of the propeller without a HC595 for such a circuit.

    Andy
  • Graham StablerGraham Stabler Posts: 2,507
    edited 2007-10-01 12:51
    www.maxim-ic.com/products/switches/audio/index.cfm

    Typical on resistances of 0.6ohm and maxim are great with samples.

    Graham
  • DavidMDavidM Posts: 626
    edited 2007-10-01 13:01
    Ok,

    Thanks for the replies,

    Did you guys look at my 2nd schematic?

    I have 1.8 v p- p which I believe is higher than normal line level audio, So this may help?

    Secondly, the 4066 is suitable for audio switching ( the spec sheet says do) so I don't see how I cannot use it, But I think what you both are saying is that I will get a drop, remember I plan to "REMIX" by sending the output of one switch into the INPUT of another switch, So I can mix the signals the way I need.
    Now if the resulting level is not enough to drive headphones directly then I will need to amplify this, I believe some kind of OPAMP is required here?


    Dave M
  • Graham StablerGraham Stabler Posts: 2,507
    edited 2007-10-01 13:11
    "suitable for audio switching" does not mean "will work in all audio applications". I'm not saying it will not work but you need to be aware of the high resistance, as long as you design with that in mind you may well be fine.

    You will get a drop proportional to the current passing through the switch, of course if you drive a speaker the current is high and so is the drop. The input impedance of an op-amp is generally very high so very little current will be drawn and the drop will be very small. This means the op-amp really just needs to act as a buffer/driver rather than actually having to amplify anything although if you want to drive a speaker you may want to amplifiy it anyway.

    Graham
  • DavidMDavidM Posts: 626
    edited 2007-10-01 13:13
    To graham,

    I just had a quick look at the MAXIM products I found this,


    MAX9729 - Stereo Headphone Amplifier with BassMax,
    Volume Control, and Input Mux

    I am just reading the spec sheet now, I think I need two of them, gotta see how much they are though!


    Thanks

    Dave M
  • DavidMDavidM Posts: 626
    edited 2007-10-01 13:23
    yes they are cheap enough if I want to by 2500 of them???

    I need samples for now, but I plan to us a bout 20 of them!


    looking at Plan C now!


    Dave M
  • Graham StablerGraham Stabler Posts: 2,507
    edited 2007-10-01 13:32
    You can buy them on the Maxim website in low quantities but you might find them tricky to solder as they are a leadless package.

    Graham
  • DavidMDavidM Posts: 626
    edited 2007-10-01 13:44
    Thanks graham,

    yes I can place orders directly for small quantities, I just found out!

    I had a look at the spec sheet , its just what I need! I can "digitally control" the volume if I wish, This is great as I am working with membrane panels!

    Can the 28-Pin TQFN-EP be placed inside a PLCC socket or similar??

    Thanks


    dave M
  • Graham StablerGraham Stabler Posts: 2,507
    edited 2007-10-01 13:46
    I don't think so but to be honest I'm not sure.
  • Ken PetersonKen Peterson Posts: 806
    edited 2007-10-01 14:15
    @DavidM:

    I'm also using the Propeller with a uMP3 player. Are you by any chance working on a SPIN object for the player? Are you going to have a user interface with song lists, etc.?

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


    The more I know, the more I know I don't know.· Is this what they call Wisdom?
Sign In or Register to comment.