|
|||||||
| Home | Forums | Rules | Articles | Store | Gallery | Blogs | Register | Donations | FAQ | Calendar | Search | Today's Posts | Mark Forums Read | Search |
| 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 |
|
![]() |
|
|
Thread Tools | Search this Thread |
|
|
#1 |
|
diyAudio Member
Join Date: Mar 2003
Location: St. Catherine, Jamaica
|
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> |
|
|
|
|
#2 |
|
diyAudio Member
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 |
|
|
|
|
#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..... |
|
|
|
|
#4 |
|
diyAudio Member
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> |
|
|
|
|
#5 |
|
diyAudio Member
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> |
|
|
|
|
#6 |
|
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. |
|
|
|
|
#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:
|
|
|
|
|
|
#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 |
|
|
|
|
#9 |
|
diyAudio Member
Join Date: Dec 2003
Location: Albuquerque
|
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 |
|
|
|
|
#10 |
|
diyAudio Member
|
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. |
|
|
![]() |
| Thread Tools | Search this Thread |
|
|
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? |