Go Back   Home > Forums > Source & Line > Digital Source
Home Forums Rules Articles Store Gallery Blogs Register Donations FAQ Calendar Search Today's Posts Mark Forums Read

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 4th April 2005, 09:17 AM   #1
simingx is offline simingx  Singapore
diyAudio Member
 
Join Date: Mar 2005
Location: 01°17.5319' N, 103°48.2319' E
Default PGA2310 and Bascom and ATMega8535

Hi, I've been cracking my head over this for the past 2 nights and just *cannot* get the simple circuit to work!

The PGA2310 is connected to a ATMega8535 as follows:
SDI : PB0
SCLK : PB1
MUTE : PB2
CS : PA1

ZCEN is permanently connected to VD+.

The source code is as follows:
Code:
$crystal = 1000000
$regfile = "m8535.dat"

Dim Totalvol As Word
Dim Volvarr As Byte
Dim Volvarl As Byte
Dim Testbit As Byte


Cs2310 Alias Porta.1
Mute2310 Alias Portb.2
Source1 Alias Portc.3

Const Wait1 = 1
Const Wait2 = 10

Config Portb = Output
Config Portc = Output
Portb = 1

Mute2310 = 1
Portc = 0

Source1 = 1
Cs2310 = 1

Totalvol = &H1111

Cs2310 = 0
Waitms 10
Shiftout Portb.0 , Portb.1 , Totalvol , 0 , Null , 1000
Waitms 10
Cs2310 = 1
When the code is executed, a quick probe with a 'scope shows the correct signals at the pins of the PGA, but no reaction! The PGA does not change it's output in any way.

Even if I do the very primitive method of bit-banging, it doesn't work too.
What could be wrong? I've already replaced a chip to no avail.
If anyone has any code, please send it...

Thanks!
  Reply With Quote
Old 4th April 2005, 05:15 PM   #2
JochenH is offline JochenH  Germany
diyAudio Member
 
Join Date: Apr 2004
Location: Aachen
Hi,

i have to say that i don't know BASCOM, but from looking at the code i see no statement where PORT A (CS-PGA2310) is set to output. Perhaps thats the problem.

Jochen
  Reply With Quote
Old 5th April 2005, 09:24 AM   #3
Bee is offline Bee  United Kingdom
diyAudio Member
 
Join Date: Oct 2002
Location: UK
Hi

I've successfully driven a CS3310 with an Atmel, and written a fair bit of Bascom code, and it does look as though your code is OK. I would set mute high, CS low, Data in high, and toggle Clock 16 times high to low and see if it works. You should also be able to watch the data go through the chip by looking at data out. Are you saying you've tried that, and checked its happening with a scope? If there's still no output, then have you double checked your implementation of the analog side?

Brian
  Reply With Quote
Old 5th April 2005, 09:56 AM   #4
diyAudio Member
 
Join Date: May 2003
Location: Krakow
Hi ,try to use the hardware SPI which is implemented in ATMega8535. I've used this metod in my project and it works. Everything is writen in bascom help.
  Reply With Quote
Old 5th April 2005, 10:33 AM   #5
simingx is offline simingx  Singapore
diyAudio Member
 
Join Date: Mar 2005
Location: 01°17.5319' N, 103°48.2319' E
D'oh!

JochenH was right...

The problem was my totally forgetting to define Port A as an output... the "correct" waveform seen by the 'scope was actually caused by the internal pullup!

The code using Shiftout works now... much more compact!

Thanks to all who looked...

me <-
  Reply With Quote
Old 5th April 2005, 12:08 PM   #6
simingx is offline simingx  Singapore
diyAudio Member
 
Join Date: Mar 2005
Location: 01°17.5319' N, 103°48.2319' E
Here are the pictures of the work in progress:

CPU board (left) and analog board (right)
Click the image to open in full size.

Close up of analog board
Click the image to open in full size.

'Scope output with output set to -6 dB (0.5x attenuation)
Both traces are set to 500mV/div.
Click the image to open in full size.
  Reply With Quote
Old 5th April 2005, 04:11 PM   #7
Bee is offline Bee  United Kingdom
diyAudio Member
 
Join Date: Oct 2002
Location: UK
Quote:
The problem was my totally forgetting to define Port A as an output...

It usually is something like that!


Nice looking boards - you should be under way now.

Have fun -


Brian
  Reply With Quote
Old 5th April 2005, 07:21 PM   #8
JochenH is offline JochenH  Germany
diyAudio Member
 
Join Date: Apr 2004
Location: Aachen
Yes, looks really nice.

When doing the listening test i would also try to bypass / replace the 2 buffer opamps with a piece of wire. Most sources have a low enough output impedance for the PGA2310, and a piece of wire sounds always more neutral (but not always better) than an opamp.

Jochen
  Reply With Quote
Old 6th April 2005, 09:03 PM   #9
gmarsh is offline gmarsh  Canada
diyAudio Member
 
gmarsh's Avatar
 
Join Date: Apr 2004
Location: Halifax, NS, Canada
That's a sexy VFD... where'd you get it?
  Reply With Quote
Old 7th April 2005, 08:15 AM   #10
MCLL is offline MCLL  Hong Kong
diyAudio Member
 
MCLL's Avatar
 
Join Date: Dec 2002
Location: Hong Kong
How much 20 x 2 VFD display?
  Reply With Quote

Reply


Hide this!Advertise here!

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
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 & NE5532 get hot? sergiusz Digital Source 10 20th December 2005 12:32 PM
PGA2310 Atmega16 + Bascom mlihl Digital Source 0 28th April 2005 12:11 PM
PGA2310 v PGA4311 daArry Digital Source 1 12th April 2005 07:52 AM
my own pga2310 pre-amp :) veteran Digital Source 22 31st August 2004 05:02 PM
CPLD vs. uC for PGA2310 ajm8372 Solid State 6 20th January 2004 10:40 PM


New To Site? Need Help?

All times are GMT. The time now is 12:54 AM.

Page generated in 0.10703 seconds (79.74% PHP - 20.26% MySQL) with 10 queries

Copyright ©1999-2012 diyAudio