PGA2311 signals
Hi for anyone who might need it here is how you send data to a pga2311 in its basic form :
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!