diyAudio

diyAudio (http://www.diyaudio.com/forums/)
-   Chip Amps (http://www.diyaudio.com/forums/chip-amps/)
-   -   PGA2311 Preamp/Selector (http://www.diyaudio.com/forums/chip-amps/106377-pga2311-preamp-selector.html)

error401 5th August 2007 10:57 AM

PGA2311 Preamp/Selector
 
2 Attachment(s)
Hey guys,

This is my first post here, but I've been lurking for quite some time now. I'm working on designing a flexible digitally controlled preamp with lots of IO for fun features. Coming from a CoSci education, I don't really have the analog electronics experience I'm going to need to pull this off on my own, so hopefully this project will generate enough interest for me to get it done.

The amp will be based around the PGA2311 as the volume control, and a set of inexpensive TQ2 DPDT relays doing the input switching and muting. System control will be handled by an Atmel AVR, probably from the ATmega164/324/644 series, along with a few MCP23008 I2C IO expanders from Microchip for main IO. Main UI will be an HD44780 LCD and a rotary encoder (with the possible facility to use a pot instead). I also plan to add IR remote control. The main goal here is to get good sound quality out of a fun and flexible project (I plan to expose lots of extra GPIO and the I2C bus for addons). I'm a digital guy and I love playing with this stuff, and there should be lots of places to go with this setup. All parts will be TH, with the exception of 1206 passives for decoupling and pullup.

I also don't think I'm set up to manufacture the boards that this will require myself, so this is a bit of an interest check as well to see if anyone's interested in sharing prototyping cost with me and possibly helping with firmware.

Currently I'm looking for ideas and advice on an appropriate output stage, as well as an opinion on whether the OPA2132 in unity gain is a good input stage for this setup. The PGA2311 has an integral opamp that can provide up to 31.5dB of gain, which will surely rail it with +/-5V supplies - should I keep it out of clipping in software, or attenuate the input and allow use of the full range? I'm not sure an output stage is really required either, the PGA2311 is supposed to be able to drive reasonable difficult loads fairly well, but it looks like most other designs put in a buffer of some sort. Advice of folks here that might've used the chip?

My current schematic is attached. Any comments are appreciated.

Dxvideo 6th August 2007 04:01 PM

I am not experienced on digital preamps. However I still have something to say about that project;
- You may want to connect PGA2311 s control line via optocouplers to the MCU. And also you may feed the PGA2311 with a seperated analog power supply. Thus gets you more "noise free" preamp.
- Why is the circuit this much complex? If you want to have four relays as input selector, one for muting (why need a mute while PGA2311 already has), three for volume encoder and three for input selector encoder. These all make just 11 I/O pins. For display you will need only four additonal (you can run it with 4+4 bit) then all makes 15. You may add one for IR receiver IC then the total pins requied is 16.. And as I see you already have 16 spare PIO pins. If you do this then your circuit includes just;
One MCU
One PGA
Five transistors
Five relays
Four LEDs
Two encoders
One buffer
One op-amp.
And some resistors.. Don't you think that circuit is a bit COMPLEX for just a preamp?
Just a suggestion.. Not for critics..
- One final thing is that PGA2311 has a 600ohm input impedance, with other words he needs to see a 600R load on input not MORE! I guess you handled that problem with that op-amps. But it needs to explained.
Anyway, I guess its a good work but some mods needed.

error401 6th August 2007 07:45 PM

Originally I chose to use the IO expanders due to increased current output - they are *just* powerful enough to drive the relays directly, but since I added the MOSFET drivers, I can now get rid of the IO registers. I think I may keep one around for fun, but you're right, it'd be a lot simpler to drive directly from the processor IO.

I was planning on having a separate analog supply for the PGA2311, but this is not clear as the power section and decoupling isn't on the schematic. Optocoupling is a good idea; then the grounds can be totally separated between the analog and digital sections.

The PGA2311 has a 10K input impedance, but the datasheet suggests it be driven by a source with 600R output impedance or less. This is the purpose of the opamp buffer, as few sources will have such a low output impedance and THD+N figures increase significantly if the PGA2311 is driven by a high impedance source. I think OPA2132 is a reasonable choice here, but suggestions are welcome, obviously these buffer stages should be as transparent as possible.

I tend to do things a bit over the top in the interest of keeping expansion options open. This usually just winds up with me making things overly complicated and never utilizing the flexibility I give myself. I think that's the case here, so thanks for the down to earth input.

jaycee 6th August 2007 08:16 PM

Just some advice :)

For driving the relays, consider TPIC6C595 from TI. This is like a regular '595, but they have DMOS common-ground FETs on the outputs that can sink 100mA - ideal for driving relays. You could also use them for driving your LEDs.

Optoisolation of the PGA2311's digital signals isn't neccesary - the chip is very clean in this regard, also as you have no doubt noticed, all analogue pins are on one side, all digital on the other making ground isolation easy :)

Rather than use some complex arrangement for the switches, why not use a resistor ladder, and then read this through one of the ADC pins ?

DO use seperate 5v supplies for analogue. Better still - use PGA2310 or PGA2320, and use 15v supplies (pretty standard for audio circuitry)

In short - see this guy's work as he's pretty much done what you want :)

error401 7th August 2007 07:27 AM

Quote:

Originally posted by jaycee
Just some advice :)

For driving the relays, consider TPIC6C595 from TI. This is like a regular '595, but they have DMOS common-ground FETs on the outputs that can sink 100mA - ideal for driving relays. You could also use them for driving your LEDs.


Gasp! Use 3 IO lines *per byte* and have less flexibility? Never! The MCP23008 can only do 25mA per output, but I2C is way more fun, and they've got configurable interrupts for inputs as well. The FET drivers are simple enough, and since I'd need back-EMF diodes on the coils if I didn't have them, they hardly increase parts count (2N7000 has integral diode). I've had my fun with traditional 7400 series logic...now on to newfangled I2C stuff :D

Quote:

Optoisolation of the PGA2311's digital signals isn't neccesary - the chip is very clean in this regard, also as you have no doubt noticed, all analogue pins are on one side, all digital on the other making ground isolation easy :)
Good to know, and I plan to avoid doing much digital IO to it anyway. Should be easy to avoid making unnecessary writes, and if I track state in the uC, should never have to read from it.

Quote:

Rather than use some complex arrangement for the switches, why not use a resistor ladder, and then read this through one of the ADC pins ?
Mostly because I avoid polling as much as possible, especially when you need to wait for the ADC. The more stuff you need to poll in your main loop the messier and more difficult your code gets to maintain. Using the MCP23008 for this allows me to use an interrupt handler to deal with the inputs (this could be hacked into a basic resistor ladder too of course). It's an extra data line and an IC as opposed to a bunch of resistors. Maybe worth thinking about though, I've got some MCP23008 coming soon so I'll see how easy they are to work with. They look fun, and make it easy to add buttons/LEDs to the design as I see fit :D

Quote:

In short - see this guy's work as he's pretty much done what you want :)
Yup, I saw that. Very nice work! His casework is especially impressive. Very inspiring.

Any thoughts on the buffers? I'm on the fence between doing a simple unity-gain opamp like on the inputs and doing some sort of discrete diamond buffers that seem to be all the rage these days. I haven't really heard any of my options; no unity gain amps in my collection...yet...

jaycee 7th August 2007 06:31 PM

Quote:

Originally posted by error401
Gasp! Use 3 IO lines *per byte* and have less flexibility? Never!

I don't see how it's less flexible if all you want to do is drive a relay or an LED. You arent using 3 IO lines per byte either... you can connect it as SPI. Either you can daisy chain them together, or you can use the RCK pin as a "chip select" since as there are two sets of shift registers, and the second set are only updated when the RCK pin is asserted.

Quote:

Originally posted by error401
The MCP23008 can only do 25mA per output, but I2C is way more fun, and they've got configurable interrupts for inputs as well.
OK for reading keys and such I guess... but pointless for LEDs and relays :)

I did look this way though.. at the MAX7301 IC.. but in the end I decided they were too much hassle (and ultimately, never built the thing anyway!)

Quote:

Originally posted by error401
Good to know, and I plan to avoid doing much digital IO to it anyway. Should be easy to avoid making unnecessary writes, and if I track state in the uC, should never have to read from it.

Yep, as long as your PCB is well designed there should be no digital breakthrough. The chip even has zero-crossing detection to avoid clicks when changing volume.

Quote:

Originally posted by error401
Mostly because I avoid polling as much as possible, especially when you need to wait for the ADC. The more stuff you need to poll in your main loop the messier and more difficult your code gets to maintain.

Very true (I'm a programmer by trade :)) In reality though you're only polling every 200ms or so, so the ADC conversion delay isnt important.

Quote:

Originally posted by error401
Yup, I saw that. Very nice work! His casework is especially impressive. Very inspiring.[/B]
Indeed, a very nice job :) You should see his A4 amplifier too, it's gorgeous and it's built mostly from recycled parts :)

Quote:

Originally posted by error401
Any thoughts on the buffers? I'm on the fence between doing a simple unity-gain opamp like on the inputs and doing some sort of discrete diamond buffers that seem to be all the rage these days. I haven't really heard any of my options; no unity gain amps in my collection...yet... [/B]
I wouldn't bother with anything fancier than a good op amp. Make the PCB so that you can experiment with gain, or no gain. Mark seems to have tried it all. He goes into quite a deep account of it in the "Analogue Research" section.

Raka 7th August 2007 08:36 PM

I did mine very similar, in particular:

I use PGA2320 for the higher rails.
The IR remote control is very useful.
I don't use couplers, and there is absolutely no noise in this aspect.
The input buffer has a gain of X2, to avoid people saying that the opamps at unity gain sound bad.
I switch also the grounds. Extra relays, I know.
Until you reach gain, which is very very unlikely, the preamp is dead quiet. You will like that.
I don't use output stage, I leave the internal opamp to drive the cable. I was considering something like a BUF634, but as I could not put it into the feedback loop, I abandoned the idea. A current opamp with muscle was considered, but the pcb was almost finished and I become a bit lazy.
With a multiplexor and a ULN2003, everything was very simple.

Ah, I almost forgot, there is something that I strongly recommend to you: prepare the software to allow for settings in the offset-level for each source. In my case the CD is lower than my LP rig, so when I change to CD, the system increases those extra dB by me. Useful for comparing sources.

You will like your pre. Sounds very clean.

gbyleveldt 8th August 2007 07:41 PM

My take on this
 
2 Attachment(s)
Hi,

Only noticed this now...

Attached find what I've done. The analogue side is based on what Mark did (as referred previously) and some of suzyj's stuff. The digital side was made up of bits I had lying around. It's typically over the top as well, but I didn't feel like re-doing it if my needs changed, so I put as much IO on as I could. I'm sure there are sleeker ways of doing it, but it works pretty good.

Notes:
Uses an AVR Mega16 for a CPU (did the code in C)
6 channel control
Two rotary encoders (volume and source select)
IR control (still need to write code for it - too lazy)
RS485 data bus to control other bits in the chain
Big VFD display

gbyleveldt 8th August 2007 07:42 PM

2 Attachment(s)
And the CPU.

Mail me if you need a little more info

Cheers

Gert

gbyleveldt 8th August 2007 07:47 PM

And some pics. I still need to turn the one knob on the lathe. *sigh*

http://i97.photobucket.com/albums/l2...Picture209.jpg
http://i97.photobucket.com/albums/l2...Picture213.jpg


All times are GMT. The time now is 10:25 AM.


vBulletin Optimisation provided by vB Optimise (Pro) - vBulletin Mods & Addons Copyright © 2014 DragonByte Technologies Ltd.
Copyright 1999-2014 diyAudio


Content Relevant URLs by vBSEO 3.3.2