Digitally controlled preamp/headphone amp - Page 3 - diyAudio
Go Back   Home > Forums > Amplifiers > Headphone Systems

Headphone Systems Everything to do with Headphones

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 18th September 2005, 07:18 PM   #21
diyAudio Member
 
Russ White's Avatar
 
Join Date: Jan 2005
Location: Nashville, TN, USA
Send a message via Yahoo to Russ White
Hi M.

I am not exactly sure how to answer your question, but here is what I found in te PGA2311 datasheet.


SWITCHING CHARACTERISTICS
Serial Clock (SCLK) Frequency fSCLK 0 6.25 0 6.25 MHz
Serial Clock (SCLK) Pulse Width LOW tPH 80 80 ns
Serial Clock (SCLK) Pulse Width HIGH tPL 80 80 ns
MUTE Pulse Width LOW tMI 2.0 2.0 ms
Input Timing
SDI Setup Time tSDS 20 20 ns
SDI Hold Time tSDH 20 20 ns
CS Falling to SCLK Rising tCSCR 90 90 ns
SCLK Falling to CS Rising tCFCS 35 35 ns
Output Timing
CS LOW to SDO Active tCSO 35 35 ns
SCLK Falling to SDO Data Valid tCFDO 60 60 ns
CS HIGH to SDO High Impedance tCSZ 100 100 ns

That is from the table in the datasheet. on page 3

On page 8 there is more information on the serial port.

Thanks for looking.
__________________
Less pulp more juice Twisted Pear Audio.
  Reply With Quote
Old 18th September 2005, 07:22 PM   #22
diyAudio Member
 
Join Date: Mar 2004
Location: Bangalore, India.
Hi Russ...

I was looking for this.

Quote:
Originally posted by Russ White

Serial Clock (SCLK) Frequency fSCLK 0 6.25 0 6.25 MHz
lemme see what i can do...

wish me luck...

~M.
  Reply With Quote
Old 18th September 2005, 07:27 PM   #23
diyAudio Member
 
Russ White's Avatar
 
Join Date: Jan 2005
Location: Nashville, TN, USA
Send a message via Yahoo to Russ White
By all means! Good luck!
__________________
Less pulp more juice Twisted Pear Audio.
  Reply With Quote
Old 18th September 2005, 09:49 PM   #24
diyAudio Member
 
Join Date: Mar 2004
Location: Bangalore, India.
Default Internal or not to internal

Hi Russ,

Just a small question. I was looking at your schematic, and realised you have not included a crystal.

If you are, what speed would you like it to run at? I assume 8MHz.

Please let me know.

Also, one small question. Instead of having a rotary encoder and stuff; have you given thought about a Digital Pot and IR(or RF ) remote?

thats all for now.

~M.
  Reply With Quote
Old 18th September 2005, 09:54 PM   #25
diyAudio Member
 
Russ White's Avatar
 
Join Date: Jan 2005
Location: Nashville, TN, USA
Send a message via Yahoo to Russ White
Default Re: Internal or not to internal

Quote:
Originally posted by saltnpeppah
Hi Russ,

Just a small question. I was looking at your schematic, and realised you have not included a crystal.

If you are, what speed would you like it to run at? I assume 8MHz.

Please let me know.

Also, one small question. Instead of having a rotary encoder and stuff; have you given thought about a Digital Pot and IR(or RF ) remote?

thats all for now.

~M.
Hmmmm...

Nope no chrystal intended. It should not be necessary I don't think.

The only human interface is from a 5K pot with the wiper read by the ADC to get my value for the PGA2311.

I have given though about the IR or RF, but I wanted to get this simple example working first.

In fact if I couldjust get the part to send the serial data to the PGA2311 I would be happy.

Thanks!
__________________
Less pulp more juice Twisted Pear Audio.
  Reply With Quote
Old 18th September 2005, 09:55 PM   #26
diyAudio Member
 
jackinnj's Avatar
 
Join Date: Apr 2002
Location: Llanddewi Brefi, NJ
Default Re: Internal or not to internal

Quote:
Originally posted by saltnpeppah
Hi Russ,

Just a small question. I was looking at your schematic, and realised you have not included a crystal.
12F683 has an internal oscillator -- you also use the power supply for VREF.

These are wonderful devices to work with.

Russ -- as you know what you want to accomplish in VB perhaps using a BX24 from Netmedia would ease your implementation --
  Reply With Quote
Old 19th September 2005, 02:02 AM   #27
diyAudio Member
 
Russ White's Avatar
 
Join Date: Jan 2005
Location: Nashville, TN, USA
Send a message via Yahoo to Russ White
Here is what I have so far, it compiles, butr I have not tested it yet.
Code:
#include <pic.h>

#define Clk GPIO4
#define Data GPIO2
#define CS GPIO1
#define POT GPIO0;

writeByte(int out) {
	int b = out;
	int i;
	for (i = 8; i > 0; i--) {
		int x = 1 << (i-1);
		if (b >= x) {
			Data = 1;
			b -= x;
		} 
		else 
		{
			Data = 0;
		}
		Clk = 1;
		Clk = 0;
	}
}

writeState(int val){
	CS = 0;
	writeByte(val);
	writeByte(val);
	CS = 1;
}

int getState() {
	GODONE = 1;
	while (GODONE){
		NOP();
	}
	return ADRESH;
	
}

main() {
	ANSEL = 1;
	ADCON0=0b001110001;
	TRIS1 = 0; // make output
	TRIS2 = 0; // make output
	TRIS4 = 0; // make output
	CS = 1;
	while (1) {
		writeState(getState());
	}
}
__________________
Less pulp more juice Twisted Pear Audio.
  Reply With Quote
Old 19th September 2005, 02:33 AM   #28
diyAudio Member
 
Russ White's Avatar
 
Join Date: Jan 2005
Location: Nashville, TN, USA
Send a message via Yahoo to Russ White
More complete....


Code:
#include <pic.h>

#define POT GPIO0;
#define CS GPIO1
#define Data GPIO2
#define ZCEN GPIO3;
#define MUTE GPIO4;
#define Clk GPIO5

writeByte(int out) {
	int b = out;
	int i;
	for (i = 8; i > 0; i--) {
		int x = 1 << (i-1);
		if (b >= x) {
			Data = 1;
			b -= x;
		} 
		else 
		{
			Data = 0;
		}
		Clk = 1;
		Clk = 0;
	}
}

writeState(int val){
	CS = 0;
	writeByte(val);
	writeByte(val);
	CS = 1;
}

int getState() {
	GODONE = 1;
	while (GODONE){
		NOP();
	}
	return ADRESH;
	
}

main() {
	int i = 0;
	ANSEL = 0b001110001;
	ADCON0 =0b000000001;
	TRIS1 = 0; // make output
	TRIS2 = 0; // make output
	TRIS3 = 0; // make output
	TRIS4 = 0; // make output
	TRIS5 = 0; // make output
	MUTE = 1;
	ZCEN = 1;
	CS = 1;
	while (1) {
		writeState(getState());
		for (i = 0; i <2000; i++) NOP();// delay
	}
}
__________________
Less pulp more juice Twisted Pear Audio.
  Reply With Quote
Old 19th September 2005, 08:51 AM   #29
diyAudio Member
 
Join Date: May 2005
Location: TN
hmm, Russ,

No register setup (WDT,OSCmode,fuse set, etc...) ?

No start up MUTE delay timing (<20mS) ?

And, not use a continuos read-write loop.
In my soft, the write routine it is execute only if dac value != of previus data, for threshold to the minimum the PGA writing (Digital noise).
In the normal conditions, the PGA do not write...

The internal osc clock has to be to very low frequency, to reduce the troubles.
With my PIC12F675 I have used 4MHZ (only value), but if the PIC12F683 have a lower osc, use it...


PS: normally are used "byte" definitions ( 8bit data ), to the place "int" (16bit data) ,obviously with ansi C compatible... (because the PIC elaborates only 1 bytes to the time)

Ciao

Mauro
  Reply With Quote
Old 19th September 2005, 12:03 PM   #30
diyAudio Member
 
Russ White's Avatar
 
Join Date: Jan 2005
Location: Nashville, TN, USA
Send a message via Yahoo to Russ White
Thanks Mauro.

Yes, I knew I still had a lot of work to do. Thanks for pointing me in the right direction.

Cheers!
Russ
__________________
Less pulp more juice Twisted Pear Audio.
  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



New To Site? Need Help?

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