Page 3 of 4 FirstFirst 1234 LastLast
Results 21 to 30 of 34

Thread: PGA2311 Digitally controlled pre-amp

  1. #21
    Still going on with this project just rebuilt my bench psu to allow for the voltages needed by PGA2311 and the pic

  2. #22
    Nice.
    Ive also been playing around with the PGA chips with an arduino. Got it working, but for some reasons the chip acted somewhat wierd after a while of use, started to clip the sound no mather what volume it was set to. Other than that, the chip worked good, and was very simple to send commands to.

  3. #23
    Hi Stian am still working on it. Thats a strange problem you are mentionning. I am goign through the PGA2311 datasheet to understand how to send commands to this device. I'll keep posted

  4. #24
    Project still alive but am scratching my head with that mechanical rotary encoder. I'll soon go forward with sending signals to PGA2311 all my time got taken up by a flyback design for which i did not have the right core too bad.

  5. #25
    A great news to be shared here my PGA2311 is working connected to a 16F84A. Its in a very basic state volume level is pre-programmed in code and sent to PGA2311 on startup and signal is flowing nicely out using a sinewave generator and monitoring on a scope. I have a small detail to fix in my code and it should be ready for next step of implementation. Everything is written in Hi tech c lite

  6. #26

    PGA2311 signals

    Hi for anyone who might need it here is how you send data to a pga2311 in its basic form : PGA2311 Timing Signals.jpg
    i don't have a logic analyzer to show the captured signal but this was taken from MPLAB SIM debugger and this is how i got the PGA2311 to work. Currently SID is being sent a volume level of 149. Note there are 2 things i did to make to make it work:

    1) delay your signal to PGA2311 by moe than 100ms because at switch on the system is muted by sending 0x00ff which is an all zero signal to mute the ic. The signal needs to be sent after these 100ms. If sent before it does not accept your volume

    2) Make sure the signal is sent in proper binary format i.e. least significant bit first then last most significant bit. For the 149 value shown here 10010101 is sent once for left channel on each rising SCLK pin signal then again 10010101 on the next rising edge clock value.

    All this was accomplished through a 16F84A using only the basic htc.h library, no special library was used like i wrote all functions and they are triggered as follows:

    1) Convert volume value as integer into binary using the basic modulous division principle to get the zeroes and ones into an array of integer- this gives the first 8 bits for one channel

    2) Copy the first 8 bits into the remainig array of integer locations to get the 16 bit values needed for left and right channel (looping through a single 8 valued array of integer twice creates a small delay in execution cycle )

    3) Set CS pin low, send the signal, set the clock to 1 then set both the signal and clock to 0 this is achieved by basic things like RA0=1, RA2=0 e.t.c. Note i used __delay_us to set the delays between CS, SCLK and SDI. The delays can be calculated from the datasheet from page 3 and page 9

    and last but not least remember PGA2311 analog voltage is only +5 and -5V ref to analog ground, i read on internet some people fried the chip by accidentally powering +15V and -15V to the analog section be careful when you order online PGA2311 is more prominent than 2310 and check you chip number when you receive your order

    Note: you won't find any of the above info in few lines like these on the net most are post in forums showing improper signals and requesting for debugging help this a proper working signal exclusive for diysmps enjoy!
    Last edited by zeus_threat; 11-17-2011 at 05:41 PM.

  7. #27
    Thanks Zeus
    www.diysmps.com & www.Micro-Audio.com

  8. #28
    More updates on this pre-amp. I have had to move to a PIC16F628A the 16F84A program memory had just reached its limit(By the end am sure i'll need to go to a 16F877A or the like if i need lcd interfacing). I have already implemented code to make th volume work as two push buttons (like on TV sets) i need to test it in a physical circuit.
    One thing which the datasheet does not say i think is that the PGA series are linear potentiometers and normally a coded approach has to be implemented to increase/decrease the volume in a logarithmic form.

  9. #29

    Working push button shcematic

    I have successfully implemented and tested the following schematic:16F628A+PGA3211.JPG. the Ic is now working with a push button for up and down volume control. I did not have any problems with output going out of control or audible clicks on volume change. I did get very minor ones beaucse i did not properly bypass the power supply pins but thats easy to solve otherwise the circuit is working great. I did not show it in the schematic but it needs to be fed with a very low output impedance <100R and output to a high input impedance >10K. I did not also get any difference in sound by bypassing the volume control.

  10. #30

    Working rotary encoder

    Just finished a code using rotary encoder for the volume control. Conclusions from test seem that everything works but i will have to run it through a PGA2311 to test. The problem was reading the rotary encoder signals properly.
    You will find a lot of tutorials all around the web but the ones leading the right way to the solutions are the ones related to "quadrature Encoder". But no where on there web is there a simple code that shows how a rotary encoder is implemented in software

    first the concepts, a 3 pin quadrature encoder provides 2 square wave signals at 90 degree off phase with one another. There are a loooooot of charts of A and B signals on the web but to get a very basic understanding of 1 and 0 sent by the encoder this link showed how to understand it: http://www.youtube.com/watch?v=uh27ftADFKo

    Passed that stage a mode detailed concept (NB i did not implement this logic in my code no need to detach and attach interrupt):http://www.youtube.com/watch?feature...&v=HQuLZHsGZdI

    To understand the direction there is a need to store the previous value from A and B as well as the new A and B value. The direction is obtained by doing an EXOr operation on current A value with previous B signal.
    The exor operation will for instance always give 1 when the encoder moved forward and 0 when the encoder moved backward.

    A trap to avoid when doing this on a microcontroller using hi tech c is to connect both A and B signals to RB4 and RB5 and use only RBIE interrupt. Do not mix INTE(RB0 interrupt) with RBIE(RB4 to RB7 interrupt)

    Additional note for PGA2311, to get an attenuation from -96dB to 0dB corresponds to decimal values 0 to 192 respectively, i.e. the software counter incremented by the rotary encoder should stay within limits of 0 to 192.

    I'll keep working and post back more results
    Last edited by zeus_threat; 05-18-2013 at 07:55 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •