PGA2310 Digital Volume Control

Status
This old topic is closed. If you want to reopen this topic, contact a moderator using the "Report Post" button.
You can't just use an encoder. If you look in the datasheet on PGA2310 you need a seriel signal who is initiated by a /CS followed by 2 times the same 8 bit data and stored by raising /CS again.
If your encoder can supply you with a 8 bit result transmitted twice it is fine. If not you have to code it in some uController.

The AVR is fine for this. If you use a type like a AT90S2313 (You can get it from ELFA or Farnell) is should more than big enough for this job.

It does not have any SPI bus, but it is easy to program. Even if it is some time since i have done this, i could help you with a routine to control the PGA.

The AVR can also stop the oscillator ... wich .. for your ears .. are a fine thing.

:)

Sonny
 
I would agree to "Paulb".
Using a rotary switch encoder doesn't help anything, you would have to use a controller nevertheless. And this would would be able to do the contact encoding too without extra hardware.
I also think the TI board is fine for just checking the proper function of the PGA, but it doesn't help you anything for your application.
So: why not jump into that microcontroller thing and get familiar with for example Atmel'S AVRs? I can tell you that it is a relatively simple job, for they provide excellent developer's help, powerful software 4free (AVR studio - everything u need) and minimum hardware requirement.
Holger
 
Hi John!
No problem!
The Datasheets of all AVR controllers are available here:
http://www.atmel.com/atmel/products/prod200.htm
Which one you choose, depends a little on the complexity of your application. The AT90S2313 is cheap and with 16 I/Os suitable for a wide range of things.
What you need for software development is the following:
http://www.atmel.com/atmel/products/prod203.htm
As I mentioned before, AVR studio (Version 3.52 is available on that site) is an excellent tool that offers an assembler, a debugger and even a very good simulator: you can run your code without having a target system, completey "dry".

Holger

[Edited by HBarske on 11-06-2001 at 06:25 PM]
 
showing volume setting

K Madsen wrote :

it seems to me that few (if any) is paying attention to the indication of the actual volume setting.

even the simplest remote volume controls (a tv or whatever) are doing that and i think its important and nice to see the volume level , we did some work on this a couple of years back and precise indication proved to me as much of a task as the volume control(s) itself.

any good ideas or input??

k madsen - km_cad@yahoo.com

---------------

In wich way do you want a precise readout of the volume setting.
On TV they have rescaled the dac-setting to 100 step from 10 or 12 bit resolution. But the easiest way to show the actual gain in the system or max powerlevel (if you go class D where you change the supply voltage) is to make a table in a micro.
If you are going to calculate a dB output, you need a lot more memory then it is necessary.
The reason is that if you use a c-compiler (The easiest path) then a LOG10 routine would require a lot of processing. Not only in flash memory but also in dataram. And one thing that is for shure .. You don't have a lot of dataram in microcontroller (if they have to be cheap).

I hope it is usefull.

Sonny
 
Re: showing volume setting

sonnya said:
If you are going to calculate a dB output, you need a lot more memory then it is necessary.
The reason is that if you use a c-compiler (The easiest path) then a LOG10 routine would require a lot of processing.

The micro doesn't have to process any logs because the data passed to the PGA2310 is in dBs (actually half-dBs) already. You can even drive an LED display directly in dBs if you wanted to without having to use LOG10(). The micro never needs to know the absolute linear gain of the amp.
 
oupss!!!

For the PGA the calculation for the gainsetting is easy and does not require a LOG10 routine. Just do 1 right shift in a micro.

31.5 - (0.5 * (255 - N)) => 31.5 - ((255 - N) / 2)

Try shift a binary number one time right it is the same as dividing by 2. It should be fairly easy to do in assembler and get a readout in -95.5 to +31.5 dB on a LCD display.

Maybe i sould have posted this in digital section.

Sonny
 
HBarske said:
Hi John!
No problem!
The Datasheets of all AVR controllers are available here:
http://www.atmel.com/atmel/products/prod200.htm
Which one you choose, depends a little on the complexity of your application. The AT90S2313 is cheap and with 16 I/Os suitable for a wide range of things.
What you need for software development is the following:
http://www.atmel.com/atmel/products/prod203.htm
As I mentioned before, AVR studio (Version 3.52 is available on that site) is an excellent tool that offers an assembler, a debugger and even a very good simulator: you can run your code without having a target system, completey "dry".

Holger

[Edited by HBarske on 11-06-2001 at 06:25 PM]

HBarske,

Thanks for the links. I have had a change to look at thier web site and it does look like they provide excellent customer support. I have downloaded all the programs I could find along with the application notes. I think I will order a few of their micros and the fixture that may be required to do development work.

Thanks again,

John Fassotte
Alaskan Audio
 
Holger,

I have committed myself to using the Atmel parts. I have ordered a bunch of AT90S2313-10PC parts along with the ATSTK500 starter kit and will use them to develop future firmware for various applications including remote control functions.

I felt confident eqnough with the information on the Atmel web site to jump in with both feet.

I would prefer to program in C if it is possible.


John Fassotte
Alaskan Audio
 
If you all would care to check the link i have posted once :

http://www.avrfreaks.com or http://www.avrfreaks.net

You will find everything you need to know about AVR and all the tools you need.
Eratta sheets.
Datasheet.
Links to compilers.
All free tools available for AVR ready to download.
A forum with a fast response even for newbies.

And it is a lot faster to find things than browsing ATMELS homepage or search through google.

I like hifiZEN's idear about a "DIY audio knowledge" the AVRFREAKS homepage has page dedicated to projects and one for Technical notes. Maybe this page could have the same features.

Sonny
 
Re: DIY Audio Knowledge Base?

hifiZen said:
Perhaps we should see if Jason can set up a DIY audio knowledge base for us. It would just be a repository for misc. schematics or schematic fragments, plus code snippets for PIC / AVR etc...
I'm all for the lazy approach too! ;)
Count me in. I plan on using the AVR too, and we have a lot of other common interests here. It's way easier to modify somebody else's (working!) code than to start from scratch. This is motivating me to finish my current project so I can start on this one!
Jason is probably pretty busy maintaining this site. Is there somebody else who could set something up? I'd be happy to contribute to the base.
 
It may be eaiser to get code snippets, etc. archived on one of the earlier mentioned avr sites. I'll confess that I'm planning to use the Atmel AVR devices in my projects also. I even bought a nice Noritake a flourescent display (uses LCD type interface)last year as front panel. Code exists at these sites already to fire the display up. Get the rotary encoder (Oak Grigsby has some nice ones with built-in pushbutton - so you can push for Volume, push for Balance, push for Listen Source Select, push for Record Source Select, push for ....), PGA2310 volume control device, AVR microcontroller device, IR receiver module, high performance analog switches (or relay drivers) for signal selection/distribution and I'll be a happy guy!

I'm still looking for my AVR code snippet for talking to Crystal's CS3310. I had a mail problem earlier this year that forced some archiving, so I dig through it in my spare time. When I find it, I'll get permission and post it here or my web site.

Michael
 
Here's a list of features I think this project needs.

IR Controls:
Volume Up
Volume Down
Mute
and Possibly Power

If the power function is implemented, we would need soft switch functionality. The micro-controller and IR would have to remain active at all times, and a soft power switch as well. The rest of the inputs would need to be ignore and power removed from the analog section.

It needs the ability to learn/store codes for each function.

The micro-controller needs a SPI serial interface to the PGA2310.

It also needs to store the volume state in non-votatile storage, perhaps this requires shutdown circuitry such as to not excessively use a non-volatile medium.

It needs a physical knob/control for the volume and a switch for the power.

Finally, it needs a method of display for the volume setting.

My 2 cents

[Edited by ertyu on 11-07-2001 at 12:33 PM]
 
ertyu said:
The micro-controller needs a SPI serial interface to the PGA2310.

It also needs to store the volume state in non-votatile storage, perhaps this requires shutdown circuitry such as to not excessively use a non-volatile medium.

ertyu,

You can use three I/O pins to simulate SPI interface, and can choose MCU without built-in SPI interface, the software isn't complex, just operations of shift register.

AVR series has built-in EEPROM, so we don't need extra chips.
 
Status
This old topic is closed. If you want to reopen this topic, contact a moderator using the "Report Post" button.