Need help!! with PCM1738 and uP code - 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 13th November 2004, 12:32 AM   #1
diyAudio Member
 
Join Date: May 2003
Location: Krakow
Default Need help!! with PCM1738 and uP code

Welcome.

I have a big problem with PCM1738 and control program. I am using Atmel ATmega 8535. The software ,I have is Bascom AVR.
In program I use SPI-hardware. This is an example of my code:

"Config Spi = Hard , Interrupt = On , Data Order = Msb , Master = Yes , Polarity = Low , Phase = 0 , Clockrate = 4

Dim Reg18a As Byte
Dim Reg18b As Byte
Reg18a = &B00010010
Reg18b = &B10110001

Spiinit
Spiout Reg18a , 1
Spiout Reg18b , 1
"
This is a main idea of course.
I tried many ways, but it does not work. I also have PGA2310 and the similar code works great. In code below i try to mute PCM1738. The main idea is to change attenuation and many useful option.


Please help me
Attached Images
File Type: jpg image001.jpg (71.7 KB, 571 views)
  Reply With Quote
Old 14th November 2004, 05:05 PM   #2
Bee is offline Bee  United Kingdom
diyAudio Member
 
Join Date: Oct 2002
Location: UK
Hi Audiopower -

Register 18 in the PCM1738 wants a 16 bit word, which you are sending to it as two bytes. I think Bascom deasserts the SS line, which I assume you are using as the PCM's CS, after each SPIOUT instruction. I'm only guessing here, but if the PGA uses its CS going high to load its shift register into its internals, then it would happen after only 8 bits.

Maybe it would work if you put reg18a and b into a two byte array, and do an SPIOUT reg18(1),2 ?

On the other hand, the PGA2310 definitely uses CS in this way, as you can daisy chain several together, and send 16 x number of chips clocks. So maybe I'm wrong.

Brian
  Reply With Quote
Old 14th November 2004, 09:56 PM   #3
diyAudio Member
 
Join Date: May 2003
Location: Krakow
Thank you very much " Bee"
You have right.Today when i have read your reply i changed the code. I used your guideline , built array and sent data with array to PCM1738. Apparently Bascom deasserts the SS line after SPIOUT instruction. Now it works. I am listening an audio now. Thank you very much for your advice. But as you noticed the pga datasheet is similar to PCM1738 in Serial control of course. In PGA when i send 8 bits for right channel then 8 bits for left , it works,unimportant.

I am very happy. Now I can change attenuation and turn on monural mode operation !!!!!!!!!!!!. When i have finished my DAC i will post photos.

Once again THANK YOU
  Reply With Quote
Old 30th November 2004, 06:56 PM   #4
Bee is offline Bee  United Kingdom
diyAudio Member
 
Join Date: Oct 2002
Location: UK
Just returned after two weeks in France.

Glad it works. I think what happens in the PGA 2310 is this: you send first the left channel data, SPIOUT deasserts CS, and it is loaded into the right hand register, which is probably wrong. You then send the right channel data, this slides the left data across 8 bits, SPIOUT deasserts CS again, and the correct data is now loaded into the left and right register. It's so fast you don't hear the glitch. So it works. In the PCM1738, one byte is a pointer to the register that the second byte has to be loaded into. So it's not surprising that bits fly in all the wrong directions!

I look forward to seeing how you get on. I too am playing with these chips, and as you have guessed I too admire Bascom.
  Reply With Quote
Old 17th December 2004, 12:12 PM   #5
diyAudio Member
 
Join Date: May 2003
Location: Krakow
Welcome again!!

I have almost finished my code. Meanwhile I did my casing for DAC.
I designed my DAC in CAD and brought it to craftsman. I post you how he did it for me. I think , I will finish all in month.
  Reply With Quote
Old 17th December 2004, 12:15 PM   #6
diyAudio Member
 
Join Date: May 2003
Location: Krakow
Attach file
Attached Images
File Type: jpg image011.jpg (79.2 KB, 372 views)
  Reply With Quote
Old 17th December 2004, 12:17 PM   #7
diyAudio Member
 
Join Date: May 2003
Location: Krakow
Photo 2
Attached Images
File Type: jpg image012.jpg (81.1 KB, 368 views)
  Reply With Quote
Old 17th December 2004, 12:22 PM   #8
hjelm is offline hjelm  Sweden
diyAudio Member
 
hjelm's Avatar
 
Join Date: Nov 2003
Location: Västerås
Really nice.
Is it standing on the four cylinders and if so do you have any kind of feet for them?
__________________
Hjelm
  Reply With Quote
Old 20th December 2004, 05:06 PM   #9
Bee is offline Bee  United Kingdom
diyAudio Member
 
Join Date: Oct 2002
Location: UK
That's looking really good. And rather large too. What are it's dimensions? And how is it finished? Anodised, or polished? Will we see it with the lid off?

Keep up the good work!
  Reply With Quote
Old 15th May 2005, 12:59 AM   #10
diyAudio Member
 
Join Date: May 2003
Location: Krakow
Welcome

Sorry that I don't respond so long. I was just very busy.
I have finished my dac at last. There is only inscription to do on my chassis. I think that silk-screen printing will be a good idea.I post you some photo. Tell me what do you think about it.


Audiopower

(If you don't measure you don't know )
Attached Images
File Type: jpg img_4029_resize.jpg (72.6 KB, 210 views)
  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
Problem witht [code]blah[/code] ? elseif Forum Problems 1 17th August 2008 01:30 AM
D1 output stage and PCM1738 Holger Barske Pass Labs 17 3rd April 2008 02:01 PM
Replace PCM1738 with PCM1792 4real Digital Source 5 20th February 2008 10:53 PM
Anyone know the date code on these? K-amps Solid State 8 23rd February 2005 09:20 PM
PCM1738 or AD1853? bocka Digital Source 6 24th January 2004 10:44 AM


New To Site? Need Help?

All times are GMT. The time now is 08:26 PM.


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