help with interfacing microcontroller to pga volume chip - diyAudio
Go Back   Home > Forums > Source & Line > Analog Line Level

Analog Line Level Preamplifiers , Passive Pre-amps, Crossovers, etc.

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 26th February 2011, 05:33 PM   #1
diyAudio Member
 
Join Date: Apr 2008
Default help with interfacing microcontroller to pga volume chip

Hello, I'm building a volume control using the PGA2311 IC and the PIC16F684 microcontroller. My project goals are to allow volume up/down, mute, and amplifier power off (via a relay), and it needs to receive its signal from both pushbuttons and a universal remote control (xbox360 remote). I know nothing of the programming involved but can easily take care of the hardware. Anyone know of such a setup that has code available? If not, some links to learning what I need to do this would be a great help.
  Reply With Quote
Old 26th February 2011, 06:25 PM   #2
Alien8 is offline Alien8  Belgium
diyAudio Member
 
Join Date: Mar 2004
Location: Leuven
Hi

I'd strongly suggest you invest some time in learning some form of programming language !
Although the opinions may differ I'd tentatively recommend jal.

A few years ago there was a similar project in Elektor (the audiolink).
The source is available and quite easy to adapt to your hardware.

Feel free to ask further assistance

It's good to invest some time in learning how to do it. It was certainly a good thing to learn about programming stuff. Just have fun.

HTH Alien8
__________________
A8
If 'I' knew what I was doing, life would sure be easier...
  Reply With Quote
Old 26th February 2011, 08:42 PM   #3
diyAudio Member
 
Join Date: Apr 2008
Well, I found this link: TheNewBoston – Free Educational Video Tutorials on Computer Programming and More! C Would that be a good place to start? Also, the part that I'm having the most difficuty with is that I'm not quite sure I grasp the description on the PGA2311 datasheet as to the implementation of the control data.
  Reply With Quote
Old 27th February 2011, 02:50 AM   #4
diyAudio Member
 
Join Date: Apr 2008
Oh, and I also have a couple PIC12F68 that I could use if they would work here.
  Reply With Quote
Old 27th February 2011, 03:22 AM   #5
suzyj is offline suzyj  Australia-Aboriginal
diyAudio Member
 
suzyj's Avatar
 
Join Date: Jan 2006
Location: Sydney
Here's how I did it:

A HiFi Preamp
  Reply With Quote
Old 27th February 2011, 04:10 AM   #6
diyAudio Member
 
Join Date: Apr 2008
Will your code work on a PIC16F684? Also, did you ever get it to decode the input from a remote control? I don't need a rotary encoder for this design.

Last edited by Lingwendil; 27th February 2011 at 04:18 AM.
  Reply With Quote
Old 27th February 2011, 06:38 PM   #7
Alien8 is offline Alien8  Belgium
diyAudio Member
 
Join Date: Mar 2004
Location: Leuven
Hi Lingwendil

My suggestion was a so called higher level programming language...
There are a lot of different choices here. Basically it turns out to be a lot easier if you pick a high level language. Here the compiler (the program that actually writes the machine code and spits out a hex file) takes care of the more difficult parts for you. The disadvantage is that time critical software may not work correct... On the other hand a lower level language expects the progammer to know a lot more of how to make a microcontroller work, but you are more in control of things.
As you've probabely guessed a low level language has a very steep learning curve........

My suggestion was to use JAL - Just Another Language (google it) which is very easy to start with. As said above, Elektor has a project published based on this language.

As to control the PGA chips : basically you need to 'select' it by pulling the cs line low (the bar above it in the datasheet means 'active' when low) and send two bytes - one for left, one for right by putting a bit on the data line and toggling the clock line. The PGA reads in a bit at each low to high transition of the clock line.
This is a common way to address and transfer data from chip to chip.
You could eg. use the data and clock lines connected to different chips and 'select' the right one to talk to using the cs line. Just leave it high for the ones you don't want to 'listen' ... Once you start you'll find yourself needing more and more pins on your microcontroller. The chip makers solved part of your problem here !
Examples are found easily on the web. The legendary preamp from mhennessy uses some of these tricks.

Good luck!
__________________
A8
If 'I' knew what I was doing, life would sure be easier...
  Reply With Quote
Old 28th February 2011, 06:41 PM   #8
diyAudio Member
 
Join Date: Apr 2008
Also, the xbox 360 remote uses rc6 protocol, and all i've been able to find is rc5, anyone know of any sites discussing rc6 in detail?
  Reply With Quote
Old 28th February 2011, 06:54 PM   #9
gfiandy is offline gfiandy  United Kingdom
diyAudio Member
 
gfiandy's Avatar
 
Join Date: Jul 2003
Location: Cambridge UK
I am not sure this is still true but when I was still working on this RC5 was developed by Philips and they released it for use unlicenced. It was very popular so they developed a new improved version RC6 which they licence to manufacturers.

Hence you may find it difficult to find data on RC6 on the web.

Regards,
Andrew
  Reply With Quote
Old 1st March 2011, 06:37 AM   #10
Alien8 is offline Alien8  Belgium
diyAudio Member
 
Join Date: Mar 2004
Location: Leuven
For RC6 check : rc6 encoding

Are you sure all the commands on your remote are RC6 ? There is also an extended (more than 64 commands) RC5 available. Sometimes that is used and mistakenly advertised as RC6.

I once started on a decoding algorithm for RC6 but since I have a programmable remote I have no more need for that.

A8
__________________
A8
If 'I' knew what I was doing, life would sure be easier...
  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
volume remote control module with PGA 2311 Jempie Analog Line Level 159 22nd February 2014 02:49 PM
simple bass, treble, volume for a chip amp darkczar Chip Amps 6 23rd January 2012 03:53 PM
Cheap volume control chip nightanole Analog Line Level 3 9th January 2011 11:53 PM
adding volume control to my chip amp darkczar Chip Amps 12 5th October 2010 12:27 PM
Proximity of volume control to chip in IGC Nuuk Chip Amps 22 25th July 2003 07:48 PM


New To Site? Need Help?

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