Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

[SOLVED] DAC AD5312 Schematic Problem?

Status
Not open for further replies.

joydeepsarkar87

Member level 2
Joined
Jun 29, 2010
Messages
47
Helped
3
Reputation
6
Reaction score
2
Trophy points
1,288
Location
India
Activity points
1,563
Hello,

I am interfacing DAC AD5312 with LPC2148. I am using SPI to communicate with the DAC IC, I am using SPI driver files which is a working driver file hence there is no problem with the SPI. however whenever i send the value to the the DAC i get 0 as the corresponding output. I am thinking there might be a hardware issue which is the cause. I am attaching the Schematic. plz Check the schematic for any error.

Thanking in advance.
Joydeep
 

Joydeep,

You seem to be using unbuffered opto signals to drive the SPI interface. The edges will be quite slow and the DAC can accept data rates up to 30MHz so I would certainly consider cleaning those up with a Schmitt buffers. It may not be the problem - there may be a software problem - you could test that by bypassing the optos and see if it works then.

Keith.
 
I tried bypassing the opto signals and gave the SPI signal but still got the output as 0 when i should have got the output as 5v.
 

In which case I would suggest that software is the most likely problem. If you have the facilities then you could look at the SPI lines to make sure you are sending what you think you are sending!

Keith.
 

Keith

Thanks for your valuable inputs, really appreciate it.

Regards
Joydeep

Added after 46 minutes:

I am send the Code if you can help find out the prob it will be of gr8 help

Code:
void SPI_Init(void)
{
   U8 Status;
   U8 Data;

  PINSEL0 = (PINSEL0 & ~(3 << 12)) | (1 << 12);
  PINSEL0 = (PINSEL0 & ~(3 << 10)) | (1 << 10);
  PINSEL0 = (PINSEL0 & ~(3 << 8)) | (1 << 8);

	/* initialize SPI UART */
   SPI_PORT_DATA_SET_REG  = SPI_PORT_DATA_REG_INIT;   /* Initialize Chip Select High */

   S0SPCCR = SPI_CLOCK_DIVISOR;                       /* SPI Clock Divisor        */
   S0SPCR  = SPI_CONFIGURATION;                       /* SPI Config Register      */
   Status  = S0SPSR;                                  /* Clear Pending Status     */
   Data    = S0SPDR;                                  /* Clear Read Data Register */
}

U8 SPI_Write(U16 bytes, U8 tx[])
{
   U8 timeout;  //Completion Status
   U8 junk;     //Dummy Variable to clear Rx Buffer
   U16 i;        //Local Byte Counter
   U32 j;        //Timeout Failure Counter


   if (bytes)  {
      timeout = 0;
      for (i=0; ( (!timeout) && (i<bytes) ); i++)  {
         junk = S0SPSR;       //Clear Transfer Complete Flag
         junk = S0SPDR;       //Clear RX buffer
	      S0SPDR = tx[i];      //Transmit Character(s)

         for (j=0; ( (j<SPI_TIMEOUT) && bit_is_clear(S0SPSR, SPIF) ); j++) {};
         if ( bit_is_clear(S0SPSR, SPIF) )  {
   	      timeout = 1;	
         }
      }

   }  else  {

      timeout = 1;
   }
   return(timeout);
}
U8 test_ad5312dac(void)
{
	//PINSEL0 = (PINSEL0 & ~(3 << 14)) | (1 << 14);
	//PINSEL0 = (PINSEL0 & ~(3 << 0 )) | (1 << 0 );

	
	FIO0DIR |= (1<<7);       //SYNC
	FIO0DIR |= (1<<0);       //LDAC 
	
	FIO0CLR = 	(1<<7);		 //SYNC low
	delay(2);
	FIO0SET =	(1<<0);		 //LDAC high
	delay(2);
	
	SPI_Write( 1, 0x0F );
	SPI_Write( 1, 0xFF );
	

	FIO0CLR = (1<<0);		 //LDAC low
	delay(2);
	FIO0SET = (1<<7);		 //SYNC high
	delay(100);
}
[/code]

Added after 2 hours 43 minutes:

Keith

I have checked the MOSI line with the help of CRO and found the data transmitting out perfectly normal however i found a pretty interesting point, to complete i cycle its taking a bit more time then expected by the delay program. therefore is the data which is transmitting but a slower rate is causing the DAC not to configuare the output?

Joydeep
 

Do any one have the schematic of the DAC AD5312 interfacing with LPC2148.?? Plz help with the schematic or the code to interface the two devices..
 

Found the solution to the problem. It was a hardware problem. the circuit was faulty , instead of supplying +5v it was supplying more than +5.5v which is more than the max. limit of the DAC IC.
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top