PGA2311 Preamp/Selector

Status
This old topic is closed. If you want to reopen this topic, contact a moderator using the "Report Post" button.
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.
 

Attachments

  • preamp.pdf
    39.8 KB · Views: 3,078
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.
 
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.
 
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 :)
 
jaycee said:
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

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.

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

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...
 
error401 said:
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.

error401 said:
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!)

error401 said:
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.

error401 said:
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.

error401 said:
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 :)

error401 said:
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.
 
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.
 
My take on this

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
 

Attachments

  • main_board2.pdf
    98.1 KB · Views: 1,531
And some pics. I still need to turn the one knob on the lathe. *sigh*

Picture209.jpg

Picture213.jpg
 
Hi Raka,

My VFD is a Noritake unit and is quite low tech compared to the rest of the stuff they got. Check here I battled to get a better supplier than Farnell, but you might have better luck being in Europe.

The back lit blue LCD does look good, but can be a little hard to read from a distance. Got any pics of the result? Sorry Error401 for hi-jacjing your thread...

Cheers

Gert
 
gbyleveldt said:
Hi Raka,

My VFD is a Noritake unit and is quite low tech compared to the rest of the stuff they got. Check here I battled to get a better supplier than Farnell, but you might have better luck being in Europe.

The back lit blue LCD does look good, but can be a little hard to read from a distance. Got any pics of the result? Sorry Error401 for hi-jacjing your thread...

Cheers

Gert

No problem, better to have discussion, even if the discussion is a bit tangential. I'm actually interested in this because I couldn't find a decent source for appropriate graphic VFDs, which I would eventually want. All I can find is 20x2 (and similar) character VFDs on eBay. They're almost as cheap there as LCDs and I sorta wish I bought one instead of the blue backlight LCD I grabbed to toy with; they're certainly more readable at distance, but I think character LCDs look nicer than character VFDs.

Any ideas where to find VFD colour filters? I googled around and couldn't seem to find a source other than a couple manufacturers that didn't have contact info on their sites.

On topic: I got my microcontrollers and other gadgets (Atmel ISP programmer) that I ordered on the weekend. After using PIC in the past, this is so nice. The AVR architecture is just a blessing compared to the PIC one that I just can't blast often enough. Took all of an hour for me, having never used an AVR before, to get I2C working and lights flashing out of two separate IO expanders. It took almost a week for me to get a similar demo going with SPI and PIC with the TLC5940. Fun, fun chip that one. I'm almost tempted to toss one in this project for some fancy LED effects to exercise the excessive MCU cycles - but the switching noise... :(

PGA2311 interfacing is next, and shouldn't be too much harder. This digital stuff is so fun and easy compared to the analog :xeye:
 
Interfacing with the PGA is really simple, you will see. Let me recommend you something: as the pga has zero crossing detection also for the mute action, for the source changing you can do mute-change-demute. You can avoid potential clicks in the change.

PD: I tried some time ago to search in ebay for VFD's, but without success... I couldn't find anything. I have to improve my skills in ebay searching.
 
Raka said:
Interfacing with the PGA is really simple, you will see. Let me recommend you something: as the pga has zero crossing detection also for the mute action, for the source changing you can do mute-change-demute. You can avoid potential clicks in the change.

PD: I tried some time ago to search in ebay for VFD's, but without success... I couldn't find anything. I have to improve my skills in ebay searching.

That was already part of the plan :D. I was actually going to quickly ramp the volume down, mute, switch, unmute, then ramp up to the new (offset) level over total maybe 250ms. I find abrupt source changes very disconcerting (or maybe it's just that smooth ones are so much nicer), and these relays switch in 3ms; at full speed (<10ms source to source) I'm sure it would bother me.

Scarily enough I'm actually thinking this should be a fairly easy project, and maybe even doable home-etched with a few jumper wires :eek:.

Ahhh! Now off to the beach for 4 days and forget about electronics...my AMP5 kit just assembled is not working :(
 
error401 said:

Any ideas where to find VFD colour filters? I googled around and couldn't seem to find a source other than a couple manufacturers that didn't have contact info on their sites.

I also battled with that one, but I ended up hacking up an old VCR for it's filter. Works beautifully! You might want to pop around to your local repair shop and go through their old VCR's to have a look.

error401 said:

On topic: I got my microcontrollers and other gadgets (Atmel ISP programmer) that I ordered on the weekend. After using PIC in the past, this is so nice. The AVR architecture is just a blessing compared to the PIC one that I just can't blast often enough. Took all of an hour for me, having never used an AVR before, to get I2C working and lights flashing out of two separate IO expanders. It took almost a week for me to get a similar demo going with SPI and PIC with the TLC5940. Fun, fun chip that one. I'm almost tempted to toss one in this project for some fancy LED effects to exercise the excessive MCU cycles - but the switching noise... :(

PGA2311 interfacing is next, and shouldn't be too much harder. This digital stuff is so fun and easy compared to the analog :xeye:

My first big AVR project was also this one. Most of my work was with TI MSP's in the past, but in general AVR's are now my favourite!!

I was also concerned with the CPU clock inducing noise into my system and was going to put the CPU to sleep if it wasn't doing anything, but it turned out that with the boards split the way I did it I could not detect any CPU noise (tested with a scope) on the output. Admittedly, I'm not really using any gain in the PGA, I'm always only attenuating (ie. I'm always below 0dB).
 
Status
This old topic is closed. If you want to reopen this topic, contact a moderator using the "Report Post" button.