How to use PGA2311 in a gainclone? - diyAudio
Go Back   Home > Forums > Amplifiers > Chip Amps

Chip Amps Amplifiers based on integrated circuits

Please consider donating to help us continue to serve you.

Ads on/off / Custom Title / More PMs / More album space / Advanced printing & mass image saving
Reply
 
Thread Tools Search this Thread
Old 15th April 2006, 06:02 AM   #1
diyAudio Member
 
Join Date: Jan 2006
Location: Wisconsin....what did you expect?
Send a message via AIM to Spasticteapot
Default How to use PGA2311 in a gainclone?

The PGA2311 is an excellent volume controller, and about 10$ at Digikey. It's not hard to use, and should happily work with a gainclone.
So, my question is: How do I use the silly thing?
(Or should I bite the bullet and get a stepped attenuator?)
  Reply With Quote
Old 15th April 2006, 07:24 AM   #2
diyAudio Member
 
neutron7's Avatar
 
Join Date: Dec 2003
Location: Toronto Canada
theres a whole thread about one here
Digitally controlled preamp/headphone amp
  Reply With Quote
Old 15th April 2006, 02:12 PM   #3
diyAudio Member
 
I_Forgot's Avatar
 
Join Date: Jan 2005
Location: Phoenix, Az.
That thread used a PIC to read a pot and then set the attenuator chip accordingly. I think it would have been better to use a rotary encoder. A pot will eventually wear out and then you'll have almost the same sort of trouble with the digitally controlled device as you will with a real pot. An encoder like the Grayhill 61C11 (about $20) will not wear out in your lifetime (>1000000 rotations), and you can put the PIC to sleep when the volume setting is not being changed, eliminating the possibility of digital noise getting into the audio. The PIC will wake up when the encoder is turned if you put the encoder on the high nibble of PORTB of most PICs (all?) and enable that interrupt source.

The encoder has click stops, so it will "feel" like a stepped attenuator, and you will easily be able to bump the audio level up or down by 1/2 dB or whatever the attenuator chip allows- you can also adjust channel balance with the same precision.

Reading and determining the direction of rotation of an encoder is a simple 16 entry table.

The code for volume, balance, ramped mute and ramped unmute should fit into less than 300 bytes if you use assembly language (I did this several years ago without the balance function and it took something like 114 bytes, IFRC).

It would not be hard to add an LCD display that shows the attenuation of each channel.

You need a hardware programmer to use PIC microcontrollers. That will take an investment of about $50-100 up front, but you'll come up with ideas for more projects once you get started so it isn't a big deal. Microchip has a very good asembly language development package for free download from their site, and I think there is a "lite" C package there also. They also have many ap notes that tell how to implement serial interfaces to things like attenuator chips, read encoders, and the Application Maestro program can generate code to drive an LCD display for you- I have used it for that purpose and it works well.

Driving the PGA chip requires a "bit-bang" program that generates output that meets the PGA's input spec. It isn't hard to do. You look at the timing diagram for the PGA, then based on the uC clock freq and instruction cycle time, generate signals on three PIC pins that will meet the PGA's requirements. The exact timing is not critical, just the relative timing, so your 3 wire buss can be run as slow as you want- during code development you can run it so slowly that you can check it with a DMM if you don't have a scope to watch it.

It takes some time and effort to get familiar with the software development tools and with the PIC hardware and instruction set, but that's nothing a smart guy like you can't handle.

The assembly IDE from Microchip has a built in simulator so you can get the PIC up and running without ever seeing a PIC IC. When it comes time to build the hardware, you can go to the trouble of laying out a PCB, or you can save yourself some time and effort and buy a development board that has some extra space for your circuit (the PGA). Development boards have a socket and the minor support circuits for a PIC already wired and ready to go. Check boards made by Olimex. A web search for "PIC development board" should bring up a few thousand hits.

I recently used the Olimex PIC-MT-USB for a strobe controller and it works great. I use the display to show the flash freq. and on-time, both of which are adjustable using a rotary encoder.

I_F
  Reply With Quote
Old 16th April 2006, 03:32 AM   #4
diyAudio Member
 
Russ White's Avatar
 
Join Date: Jan 2005
Location: Nashville, TN, USA
Send a message via Yahoo to Russ White
The kookaburra uses a pot indeed which for some people is actually a much better solution then a rotary encoder. Lets looks at some of the reasons why.

A very decent pot is very cheap(like $1-2) , and will last quite a long time(decades of normal use), in fact it is not even critical if the pot starts to wear very badly as the firmware is only looking at the voltage from the pot wiper at a resolution of 8 bits. That kind of resolution is very forgiving indeed even of the worst pots I have tried. You will very definitely not get the same issues with a worn pot on the kookaburra as you would with a pot in the signal path because the kooka firmware make allowances for random noise, a standard volume pot in the signal path does not.

There is also the fact that poeple like a physical user interface that works like a volume pot. What you see in position of the pot rotation is what you get in volume out of the preamp. That is not often achieved with a rotory encoder. Often time you must rotate the encoder several times for significant volume change... that is sometimes not what people want.

That being said I actually think that a rotary encoder driven PGA2311 circuit is a fine idea, and perhaps I will make Kook II accept either one.

Anyway one design goal of the Kookaburra is a simple yet effective and smooth UI that requires no display and no expensive components at all. If a pot should (by some fluke) go bad in the lifetime of your Kookaburra, it is a $1 part to replace and you are back in business, but I wouldn't hold your breath waiting for that to happen.

Cheers!
Russ
__________________
Less pulp more juice Twisted Pear Audio.
  Reply With Quote
Old 16th April 2006, 04:52 AM   #5
diyAudio Member
 
Join Date: Jan 2006
Location: Wisconsin....what did you expect?
Send a message via AIM to Spasticteapot
I've got a programmer, a PIC, and can likely get it programmed to work properly. All I need is an explination of where I need to stick a buffer.
Speaking of which, I thought that the PGA2311 liked having a buffer in front of it, not behind it. That said, I was likely to use on anyway.

So, a (simple) block diagram:

Input source from CD player or DAC-> PGA2311 -> Buffer -> Gainclone.

Sound good?

Oh, and by the way: I intend to have it all programmed digitally, and buttons are not only cheap, but they last decades. (Plus, it'll work by remote control if I can figure out how to program one!)
  Reply With Quote
Old 16th April 2006, 09:34 AM   #6
diyAudio Moderator
 
pinkmouse's Avatar
 
Join Date: Apr 2002
Location: Chatham, England
Spasticteapot, one suggestion - there are plenty of 2 channel preamps around, why not make it a six or 8 channel device from the start, so it can be used for HT systems? If I can find the time, I might even be able to help with the PCB layout and prototyping.
__________________
Rick: Oh Cliff / Sometimes it must be difficult not to feel as if / You really are a cliff / when fascists keep trying to push you over it! / Are they the lemmings / Or are you, Cliff? / Or are you Cliff?
  Reply With Quote
Old 16th April 2006, 09:39 AM   #7
Raka is offline Raka  Europe
diyAudio Member
 
Raka's Avatar
 
Join Date: Aug 2002
Location: Close to Oistrakh
I'm working right now in a pre using the PGA2310, LCD and remote control. Once you get this, going to more channels would be pretty obvious programming wise, but you would need for sure more ports than the 16F84 until the PGA8311 is released (which is on it's way)
__________________
What is beyond the speaker?
  Reply With Quote
Old 16th April 2006, 09:43 AM   #8
diyAudio Moderator
 
pinkmouse's Avatar
 
Join Date: Apr 2002
Location: Chatham, England
The only issue with the PGA8311 is the tiny surface mount package...
__________________
Rick: Oh Cliff / Sometimes it must be difficult not to feel as if / You really are a cliff / when fascists keep trying to push you over it! / Are they the lemmings / Or are you, Cliff? / Or are you Cliff?
  Reply With Quote
Old 16th April 2006, 01:27 PM   #9
diyAudio Member
 
Russ White's Avatar
 
Join Date: Jan 2005
Location: Nashville, TN, USA
Send a message via Yahoo to Russ White
Quote:
Originally posted by Spasticteapot
Input source from CD player or DAC-> PGA2311 -> Buffer -> Gainclone.

Sound good?
Well lets explore the reasons for the buffers.

The PGAxx10/11 have very low input impedance somewhere around 1-2K for most volumes. And if you actually measure it you will see it actually changes with the volume setting.

There are a lot of sources(CDPs and DACS) that have output capacitors, and they will have their corner frequnecy raised to unacceptably high frequencies and give you nasty phase shifts if you went straight into the PGA. The an input buffer is a very wise thing to include as it will raise the input impedance into your circuit.

There are also some sources (TUBE DACS and such) that have a high output impedance, they also will require a buffer on the PGA's input.

An output buffer is only necessary if you wish to dive a load < 600ohms such as headphones. For an normal gainclone you really do not need an output buffer at all, but it certainly does not harm anything. If you wish the flexibility to drive either a very low input impedance power amp or headphones make the buffer optional.

So IMHO the best solution for a pure premp would be:

Source ---> Buffer(optional) ---> PGA ----> Buffer(optional) ---> Output (power amp or headphone).

Control is arbitrary. In fact if you study the kookaburra design carefully you will notice that you could easily add just about any user interface by simply using a small protoboard and a couple headers.

Have fun, I am sure you will have a blast!

I have an 8 channel design which utilized 2 x PGA4311 which works great until PGA8311 comes along.

Cheers!
Russ
__________________
Less pulp more juice Twisted Pear Audio.
  Reply With Quote
Old 16th April 2006, 03:59 PM   #10
diyAudio Member
 
Join Date: Jan 2006
Location: Wisconsin....what did you expect?
Send a message via AIM to Spasticteapot
You know, I'm pretty sure that the 2311 and 4311 can be daisy-chained. That said, right now I just need two channels; if necessary, I can just use a serial cable to connect a second preamplifier to the PIC.
Also, I'm using the 16f877A. Pins galore!
  Reply With Quote

Reply


Hide this!Advertise here!
Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
PGA2311 Preamp/Selector error401 Chip Amps 30 18th December 2009 10:55 PM
PGA2311 power off transient breez Digital Source 6 28th July 2008 06:44 PM
pga2310/pga2311 source ygm Parts 6 17th May 2006 02:52 PM
PGA2311 control Hisatugo Digital Source 0 15th June 2005 11:07 PM
PGA2311 or resistor divider? fmak Parts 2 3rd May 2004 03:34 PM


New To Site? Need Help?

All times are GMT. The time now is 01:03 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