I cant get this PGA2310 chip to work - diyAudio
Go Back   Home > Forums > Source & Line > Digital Source

Digital Source Digital Players and Recorders: CD , SACD , Tape, Memory Card, 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 April 2007, 11:01 PM   #1
diyAudio Member
 
lawbadman's Avatar
 
Join Date: Mar 2003
Location: St. Catherine, Jamaica
Angry I cant get this PGA2310 chip to work

Hello all,

I have been working on a preamp using a PIC 16F877 and a PGA2310 but with no luck.
I cannot get the volume to work properly for the PGA2310.

I have been using the SPI port to send the 16 bits to the chip. The first 8 bits are fine but the second 8 bits get messed up. I think I have timing issues. I tried waiting till the first SPI transfer was done (checking PR1 register bit 3 for a '1') and then sending the other 8 bits, but the wait was too long. Then I tried adding 'nop' instructions instead of checking the PR1 register, this was a little better with two 'nop' instructions but still no good.

Can anyone point me in the right direction as to how to get this thing working??



Thanks,
Lawrence



BTW- I program in assembly
__________________
<a href="http://www.danasoft.com"><img src="http://www.danasoft.com/sig/lawbadman.jpg" border="0"></a><div style="font-family:arial,sans-serif;font-size:11px;"><p>Sign by Danasoft - <a href="http://www.danasoft.com">For Backgrounds and Layouts</a></p></div>
  Reply With Quote
Old 27th April 2007, 12:22 AM   #2
diyAudio Member
 
I_Forgot's Avatar
 
Join Date: Jan 2005
Location: Phoenix, Az.
Schematic diagram, code?

Are you sending the data too fast for the PGA2310? Check the timing diagram on the data sheet and compare it to the timing diagram for the PIC SPI port with the resonator/oscillator you're using to clock the PIC.

I_F
  Reply With Quote
Old 27th April 2007, 07:22 AM   #3
diyAudio Member
 
Join Date: Mar 2007
what you have to do send 16 bits of data to PGA is define variables as:
one variable containing data of both channels as word byte
one variable defined as byte containing data of left channel
one variable defined as byte containing data of right channel
when you want to shift data to PGA transfer word variable and you ll be able to operate both channels.
Right now I am working on two different version of pre around PIC and PGA myself one isa simple version and other is a high end one.
I have got the board (made in my own fabrication unit).
Here is the PIC of the simple version pre board ( I ve got 6 each)
Hopefully you ll be able to control both channels if you still have problems let me know and I ll try to help.....
Attached Images
File Type: jpg simplepre.jpg (78.6 KB, 417 views)
  Reply With Quote
Old 28th April 2007, 03:43 AM   #4
diyAudio Member
 
lawbadman's Avatar
 
Join Date: Mar 2003
Location: St. Catherine, Jamaica
I dont understand how to do all that you have suggested.
How do I define a word byte.
As far as I know the PIC only can handle 1 byte (8 bits) variable.

I do have a 8 bit variable which keeps the volume level data, what do I do with it?
Sending it twice does not work. If I send it once how do I know how long to wait before I send the other?
__________________
<a href="http://www.danasoft.com"><img src="http://www.danasoft.com/sig/lawbadman.jpg" border="0"></a><div style="font-family:arial,sans-serif;font-size:11px;"><p>Sign by Danasoft - <a href="http://www.danasoft.com">For Backgrounds and Layouts</a></p></div>
  Reply With Quote
Old 28th April 2007, 06:50 PM   #5
diyAudio Member
 
lawbadman's Avatar
 
Join Date: Mar 2003
Location: St. Catherine, Jamaica
I have tried the following but it does not work:

movw SSPBUF
movw SSPBUF


I have also tried the following but it does not work either:

movw SSPBUF
write_again
btfss PIR1, 3
goto write_again
movw SSPBUF

Does anyone have any ideas or suggestions?


Thanks
Lawrence
__________________
<a href="http://www.danasoft.com"><img src="http://www.danasoft.com/sig/lawbadman.jpg" border="0"></a><div style="font-family:arial,sans-serif;font-size:11px;"><p>Sign by Danasoft - <a href="http://www.danasoft.com">For Backgrounds and Layouts</a></p></div>
  Reply With Quote
Old 29th April 2007, 01:09 AM   #6
jaycee is offline jaycee  United Kingdom
diyAudio Member
 
Join Date: Apr 2004
Location: Norwich, UK
Must be possible... Mark Hennessy used this controller in his Preamp which is the same thing, pretty much.

Would need to see your setup code to comment further. Only thing I can think is that the MSSP is not set up right. You should just be able to assert the PGA2310's chip select, send two 8-bit values out through SPI consecutively, and unassert it.
  Reply With Quote
Old 30th April 2007, 04:00 AM   #7
diyAudio Member
 
Join Date: Mar 2007
_vol_r equ _vol
_vol_l equ _vol + 001h
_vol_byte0 equ _vol
_vol_byte1 equ _vol + 001h

_shift_l equ 00018h
_shift_r equ 0001ch


label?l _shift
Low?t _cs
pauseus?C 064h
shiftdata?t _sdi
shiftclock?t _sclk
shiftmode?C 005h
shiftout?wc _vol, 010h
High?t _cs
pauseus?C 064h
High?t _sdi
Return?

Hope it helps, otherwise share your schematics I may be able to help you, or may be send a pre-programmed PIC-MCU based on your schematics.
Quote:
Must be possible... Mark Hennessy used this controller in his Preamp which is the same thing, pretty much.
not must be possible it is very much possible. Google around and you may found lots of projects build around PIC MCU and PGAs, only catch is not every one is willing to share his firmware. There was one project build around PGA and PIC in elector as well.
  Reply With Quote
Old 4th May 2007, 07:08 AM   #8
diyAudio Member
 
Join Date: Mar 2007
have a look at the following thread, once I am through with debugging the code I ll post the firmware at the board.
My mcu based pre Amp projects
  Reply With Quote
Old 4th May 2007, 10:48 AM   #9
ALBQ is offline ALBQ  United States
diyAudio Member
 
Join Date: Dec 2003
Location: Albuquerque
Default Another THread

Here is another thread where a basic stamp was used to control a PGA2310. The code segment is in basic so, between the schematic and code, pretty easy to understand how the chip is addressed.
Best of luck - ALBQ


DIY Remote Control for Everyone
  Reply With Quote
Old 4th May 2007, 03:39 PM   #10
diyAudio Member
 
Join Date: May 2007
Send a message via ICQ to s_volkovoy
As far as I remember PIC just can't tranfer data too fast, as PGA2310 cant recieve. The most probable problem is chip select (CS) signal. If you use fully hardware SPI the PIC's SPI controller changes CS during every transaction, so PGA2310 sees only one byte. The most common solution is conecting PGA's CS pin to PIC's general purpuse pin and manual CS control.
If you do this way you should go the following steps:
1- Set active CS (on GPIO)
2- Send first byte
3- Send second byte
4- Set inactive CS
__________________
There is no miracles, just short circut and circut brake.
  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
pga2310 preamplifier mos Digital Source 2 6th September 2006 02:04 AM
WTB programmed control chip for pga2310 jaudio Swap Meet 2 29th August 2006 10:27 PM
would a chip amp work on a mini subwoofer PimpMyRide Chip Amps 4 15th November 2005 11:00 AM
my own pga2310 pre-amp :) veteran Digital Source 22 31st August 2004 05:02 PM
has anyone tried the PGA2310 or Wolfson chip yet? dorkus Solid State 26 10th July 2002 08:35 PM


New To Site? Need Help?

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