This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

DAC8563: TMS320F28377S, SPI

Part Number: DAC8563
Other Parts Discussed in Thread: TMS320F28377S

Hi everyone

I'm use DAC8563, and i follow the data sheet to drive the DAC8563, but it cannot work and doesn't have any output signal

i'm coding the SPI progam in the LaunchPadXL TMS320F28377S below is the 2MHz SPI signal which is up date every 10ms of the SPI data (this prob data is form the micro controller reset)

the connection pin on the DAC8563 of the LDAC and CLR is to the ground

it's seems every thing is fine, but DAC8563 cannot work!! Please help me.

7206.main.c
//###########################################################################
//
// FILE:   McBSP_SPI_DLB.c
//
// TITLE:  McBSP Loopback using SPI mode
//
//! \addtogroup cpu01_example_list
//! <h1>McBSP Loopback using SPI mode (mcbsp_spi_loopback)</h1>
//!
//!  This program will execute and transmit words until terminated by the user.
//!  SPI master mode transfer of 32-bit word size with digital loopback
//!  enabled.
//!
//!  \b McBSP \b Signals - \b SPI \b equivalent
//!  - MCLKX - SPICLK  (master)
//!  - MFSX  - SPISTE  (master)
//!  - MDX   - SPISIMO
//!  - MCLKR - SPICLK  (slave - not used for this example)
//!  - MFSR  - SPISTE  (slave - not used for this example)
//!  - MDR   - SPISOMI (not used for this example)
//!
//!  By default for the McBSP examples, the McBSP sample rate generator (SRG)
//!  input clock frequency is LSPCLK 80E6/4.
//!
//! \b Watch \b Variables: \n
//! - sdata1 - Sent data word(1)
//! - sdata2 - Sent data word(2)
//! - rdata1 - Received data word(1)
//! - rdata2 - Received data word(2)
//!
//
//###########################################################################
// $TI Release: F2837xS Support Library v210 $
// $Release Date: Tue Nov  1 15:35:23 CDT 2016 $
// $Copyright: Copyright (C) 2014-2016 Texas Instruments Incorporated -
//             http://www.ti.com/ ALL RIGHTS RESERVED $
//###########################################################################

//
// Included Files
//
#include "F28x_Project.h"
#include "main.h"

//
// Globals
//
Uint16 sdata1 = 0x000;    // Sent Data
Uint16 rdata1 = 0x000;    // Received Data
Uint16 sdata2 = 0x000;    // Sent Data
Uint16 rdata2 = 0x000;    // Received Data
Uint16 usDacValue = 0x000;
char cmd_state = 0x00;

//
// Function Prototypes
//
__interrupt void cpu_timer0_isr(void);
__interrupt void Mcbsp_TxINTA_ISR(void);
//__interrupt void Mcbsp_RxINTA_ISR(void);

void init_mcbsp_spi(void);
void mcbsp_xmit(int a, int b);
void DAC8562_SetData(char _ch, Uint16 _dac);
void bsp_InitDAC8562(void);
void PinOutInit(void);
void error(void);

//
// Main
//
void main(void)
{
//
// Step 1. Initialize System Control:
// PLL, WatchDog, enable Peripheral Clocks
// This example function is found in the F2837xS_SysCtrl.c file.
//
   InitSysCtrl();

//
// Step 2. Initialize GPIO:
// This example function is found in the F2837xS_Gpio.c file and
// illustrates how to set the GPIO to it's default state.
// For this example, only enable the GPIO for McBSP-A
//
   InitMcbspaGpio();
   PinOutInit();

//
// Step 3. Clear all interrupts and initialize PIE vector table:
// Disable CPU interrupts
//
   DINT;

//
// Initialize PIE control registers to their default state.
// The default state is all PIE interrupts disabled and flags
// are cleared.
// This function is found in the F2837xS_PieCtrl.c file.
//
   InitPieCtrl();

//
// Disable CPU interrupts and clear all CPU interrupt flags:
//
   IER = 0x0000;
   IFR = 0x0000;

//
// Initialize the PIE vector table with pointers to the shell Interrupt
// Service Routines (ISR).
// This will populate the entire table, even if the interrupt
// is not used in this example.  This is useful for debug purposes.
// The shell ISR routines are found in F2837xS_DefaultIsr.c.
// This function is found in F2837xS_PieVect.c.
//
   InitPieVectTable();


//
// Interrupts that are used in this example are re-mapped to
// ISR functions found within this file.
//
   EALLOW;    // Allow access to EALLOW protected registers
   PieVectTable.TIMER0_INT = &cpu_timer0_isr;
   //PieVectTable.MCBSPA_RX_INT = &Mcbsp_RxINTA_ISR;
   PieVectTable.MCBSPA_TX_INT = &Mcbsp_TxINTA_ISR;
   EDIS;      // Disable access to EALLOW protected registers

//
// Step 4. User specific code
//
   init_mcbsp_spi();
   InitCpuTimers();

//
// Configure CPU-Timer 0, 1, and 2 to interrupt every second:
// 200MHz CPU Freq, 1 second Period (in uSeconds)
//
   ConfigCpuTimer(&CpuTimer0, 200, 10000);

//
// To ensure precise timing, use write-only instructions to write to the
// entire register. Therefore, if any of the configuration bits are changed in
// ConfigCpuTimer and InitCpuTimers (in F2837xS_cputimervars.h), the below
// settings must also be updated.
//
   CpuTimer0Regs.TCR.all = 0x4000;
//   CpuTimer1Regs.TCR.all = 0x4000;
//   CpuTimer2Regs.TCR.all = 0x4000;


//
// Enable interrupts required for this example
//
   PieCtrlRegs.PIECTRL.bit.ENPIE = 1;   // Enable the PIE block
   PieCtrlRegs.PIEIER6.bit.INTx5 = 1;   // Enable PIE Group 6, INT 5
   PieCtrlRegs.PIEIER6.bit.INTx6 = 1;   // Enable PIE Group 6, INT 6

//
// Enable TINT0 in the PIE: Group 1 interrupt 7
//
   PieCtrlRegs.PIEIER1.bit.INTx7 = 1;

//   IER = 0x20;                          // Enable CPU INT6
   IER |= M_INT6;
//
// Enable CPU int1 which is connected to CPU-Timer 0, CPU int13
// which is connected to CPU-Timer 1, and CPU int 14, which is connected
// to CPU-Timer 2:
//
   IER |= M_INT1;
//   IER |= M_INT13;
//   IER |= M_INT14;
   EINT;                                // Enable Global Interrupts


   sdata1 = 0xAAAA;
   sdata2 = 0xAA;

   usDacValue = 32768;
   //bsp_InitDAC8562();
//
// Main loop to transfer 32-bit words through MCBSP in SPI mode periodically
//
   for(;;)
   {
	   //mcbsp_xmit(sdata1,sdata2);
	   //DAC8562_SetData(0, usDacValue);

        //
        // Master waits until RX data is ready
        //
        //while( McbspaRegs.SPCR1.bit.RRDY == 0 ) {}
        rdata2 = McbspaRegs.DRR2.all;   // Read DRR2 first.
        rdata1 = McbspaRegs.DRR1.all;   // Then read DRR1 to complete
                                        // receiving of data.

        //
        // Check that correct data is received.
        //
        if((rdata2 != sdata2)&&(rdata1 != sdata1))
        {
            //error( );
        }

        delay_loop();

        //sdata1^=0xFFFF;
        //sdata2^=0xFF;

       __asm("    nop");                // Good place for a breakpoint
   }
}


//
// error - Error function to halt debugger
//
void error(void)
{
   __asm("     ESTOP0");  // test failed!! Stop!
    for (;;);
}

//
// init_mcbsp_spi - Configure McBSP settings
//
void init_mcbsp_spi()
{
    //
    // McBSP-A register settings
    //
    McbspaRegs.SPCR2.all = 0x0000;       // Reset FS generator, sample rate
                                         // generator & transmitter
    McbspaRegs.SPCR1.all = 0x0000;       // Reset Receiver, Right justify word,
                                         // Digital loopback dis.
    McbspaRegs.PCR.all = 0x0F08;         //(CLKXM=CLKRM=FSXM=FSRM= 1, FSXP = 1)
    McbspaRegs.SPCR1.bit.DLB = 1;
    McbspaRegs.SPCR1.bit.CLKSTP = 0x02;     // Together with CLKXP/CLKRP
                                         // determines clocking scheme
    McbspaRegs.PCR.bit.CLKXP = 0;        // CPOL = 0, CPHA = 0 rising edge
                                         // no delay
    McbspaRegs.PCR.bit.CLKRP = 0;
    McbspaRegs.RCR2.bit.RDATDLY = 01;    // FSX setup time 1 in master mode.
                                         // 0 for slave mode (Receive)
    McbspaRegs.XCR2.bit.XDATDLY = 01;    // FSX setup time 1 in master mode.
                                         // 0 for slave mode (Transmit)

    //McbspaRegs.RCR1.bit.RWDLEN1 = 4;     // 32-bit word
    //McbspaRegs.XCR1.bit.XWDLEN1 = 4;     // 32-bit word
    InitMcbspa24bit();

    McbspaRegs.SRGR2.all = 0x2000;       // CLKSM=1, FPER = 1 CLKG periods
    //McbspaRegs.SRGR1.all = 0x000F;       // Frame Width = 1 CLKG period,
                                         // CLKGDV=16
    McbspaRegs.SRGR1.all = 0x0032;			//SPI in 1Mhz for test
    //McbspaRegs.SRGR1.all = 0x0000;		//SPI in 50Mhz

    McbspaRegs.MFFINT.bit.XINT = 1; // Enable Transmit Interrupts

    McbspaRegs.SPCR2.bit.GRST = 1;       // Enable the sample rate generator
    delay_loop();                        // Wait at least 2 SRG clock cycles
    McbspaRegs.SPCR2.bit.XRST = 1;       // Release TX from Reset
    McbspaRegs.SPCR1.bit.RRST = 1;       // Release RX from Reset
    McbspaRegs.SPCR2.bit.FRST = 1;       // Frame Sync Generator reset
}

//
// mcbsp_xmit - Transmit MCBSP data
//
void mcbsp_xmit(int a, int b)
{
    McbspaRegs.DXR2.all = b;
    McbspaRegs.DXR1.all = a;
}


void DAC8562_SetData(char _ch, Uint16 _dac)
{
	if (_ch == 0)
	{
		/* Write to DAC-A input register and update DAC-A; */
		McbspaRegs.DXR2.all = (3 << 3);
		McbspaRegs.DXR1.all = (_dac << 0);
	}
	else if (_ch == 1)
	{
		/* Write to DAC-B input register and update DAC-A; */
		McbspaRegs.DXR2.all = (3 << 3)|(1 << 0);
		McbspaRegs.DXR1.all = (_dac << 0);
	}
}

void bsp_InitDAC8562_PwrUP(void)
{
	if(ENUM_DACINIT == cmd_state)
	{
		cmd_state = ENUM_DACPWRUP;
	}

	else if(ENUM_DACPWRUP == cmd_state)
	{
		/*Power up DAC-A and DAC-B */
		/* DAC8562_WriteCmd((4 << 19) | (0 << 16) | (3 << 0)); */
		McbspaRegs.DXR2.all = (4 << 3);
		McbspaRegs.DXR1.all = (3 << 0);

		cmd_state = ENUM_DACSETUP_LOAD;
	}

	else if(ENUM_DACSETUP_LOAD == cmd_state)
	{
		/* LDAC pin inactive for DAC-A and DAC-B */
		/* DAC8562_WriteCmd((6 << 19) | (0 << 16) | (3 << 0)); */
		McbspaRegs.DXR2.all = (6 << 3);
		McbspaRegs.DXR1.all = (3 << 0);

		cmd_state = ENUM_DACSETCHA;
	}

	else if(ENUM_DACSETCHA == cmd_state)
	{
		DAC8562_SetData(0, 32767);

		cmd_state = ENUM_DACSETCHB;
	}

	else if(ENUM_DACSETCHB == cmd_state)
	{
		DAC8562_SetData(1, 32767);

		cmd_state = ENUM_DACSETUP_GAIN;
	}

	else if(ENUM_DACSETUP_GAIN == cmd_state)
	{
		/* Select GAIN = 2 */
		/*DAC8562_WriteCmd((7 << 19) | (0 << 16) | (1 << 0)); */
		McbspaRegs.DXR2.all = (7 << 3);
		McbspaRegs.DXR1.all = (1 << 0);

		cmd_state = ENUM_PWRCOMPLETE;
	}

	else if(ENUM_PWRCOMPLETE == cmd_state)
	{
		DAC8562_SetData(0, 0);

		cmd_state = ENUM_DACRUN_CHA;
	}

	else if(ENUM_DACRUN_CHA == cmd_state)
	{
		DAC8562_SetData(1, 0xFFFF);

		cmd_state = ENUM_DACRUN_CHB;
	}

	else if(ENUM_DACRUN_CHB == cmd_state)
	{
		DAC8562_SetData(0, 0xFFFF);

		cmd_state = ENUM_DACRUN_CHA;
	}
}


//
// Mcbsp_TxINTA_ISR - Mcbsp Transmit ISR
//
__interrupt void Mcbsp_TxINTA_ISR(void)
{
    //
    // To receive more interrupts from this PIE group, acknowledge
    // this interrupt
    //
    PieCtrlRegs.PIEACK.all = PIEACK_GROUP6;
}


//
// cpu_timer0_isr - CPU Timer0 ISR with interrupt counterxx
//
__interrupt void cpu_timer0_isr(void)
{
   CpuTimer0.InterruptCount++;
   GpioDataRegs.GPATOGGLE.bit.GPIO12 = 1;
   GpioDataRegs.GPATOGGLE.bit.GPIO13 = 1;

   bsp_InitDAC8562_PwrUP();

   PieCtrlRegs.PIEACK.all = PIEACK_GROUP1;
}

void PinOutInit(void)
{
	GPIO_SetupPinMux(12, GPIO_MUX_CPU1, 0);
	GPIO_SetupPinOptions(12, GPIO_OUTPUT, GPIO_PUSHPULL);

	GPIO_SetupPinMux(13, GPIO_MUX_CPU1, 0);
	GPIO_SetupPinOptions(13, GPIO_OUTPUT, GPIO_PUSHPULL);

}







  • Hi Huang,

    Thank you for your query. Why are you making CLR zero because this will clear the outputs. Could you please post a scope capture of a DAC write? I think the one you posted only brings the DAC out of power down.

    Regards,
    Uttam Sahu
    Applications Engineer, Precision DACs
  • Hi Uttam Sahu
    What is the CLR pin need? give it high? 3.3v or 5v?
    I can post the image but the output just zero voltage
  • Hi Huang,

    The CLRn pin makes the outputs zero. Hence it should be tied to AVDD if not used.

    Regards,
    Uttam
  • Hi Uttam

    i have not tried it, but i will do it today and i have a question when i found the CLRn Pin explanation in the SLAS719E.

    I am using DAC8563 now, if the CLRn pin connect to ground, it should came out AVDD/2 not Zero voltage, is this correct?

  • Hi Uttam

    i found this design, it's great, and also use DAC8563, and the CLRn pin connect to AVDD, can i reference it?

    http://www.ti.com/tool/TIPD155
  • Hi Huang,

    You can tie the CLRn pin to AVDD.

    Regards,
    Uttam
  • Hi Uttam

    i have tried, but it just no output, and i also try to LDAC pin connect to the AVDD, the output also zero
    did i miss something?
  • Hi Uttam

    i have tried, but it just no output, and i also try to LDAC pin connect to the AVDD, the output also zero
    did i miss something?
  • Hi Huang,

    If you want to update the output immediately after the SPI write, you need to tie LDAC low. Or else you need to toggle LDAC after every write. Could you please share your schematics?

    Regards,
    Uttam
  • Hi Uttam,

    The schematics please fine the attachment.

    About the LDAC pin i have set to gound and AVDD, and didn't work.

    Regarding the LDAC effect output, i set the SPI command to "LDAC pin inactive for DAC-B and DAC-A"


    Regards,
    Alex

    DAC8563.pdf

  • Hi Huang,

    Could you please send me the hex codes you are writing to the DAC? You may not be updating the DACs after writing to them. It is required as you have made the LDAC pin inactive for both channels.

    The schematic looks fine.

    Regards,

    Uttam

  • hi Uttam

    here is the hex command from the controller initial to sent the SPI command

    untitled.txt
    Time [s], Analyzer Name, Decoded Protocol Result
    0.022665062500000,SPI,MOSI: 0xFFFFFF;  MISO: 0x200003
    0.032666937500000,SPI,MOSI: 0xFFFFFF;  MISO: 0x300003
    0.042668812500000,SPI,MOSI: 0xFFFFFF;  MISO: 0x187FFF
    0.052670687500000,SPI,MOSI: 0xFFFFFF;  MISO: 0x197FFF
    0.062672562500000,SPI,MOSI: 0xFFFFFF;  MISO: 0x380001
    0.072674437500000,SPI,MOSI: 0xFFFFFF;  MISO: 0x180000
    0.082676312500000,SPI,MOSI: 0xFFFFFF;  MISO: 0x197FFF
    0.092678187500000,SPI,MOSI: 0xFFFFFF;  MISO: 0x187FFF
    0.102680062500000,SPI,MOSI: 0xFFFFFF;  MISO: 0x197FFF
    0.112681937500000,SPI,MOSI: 0xFFFFFF;  MISO: 0x187FFF
    0.122683812500000,SPI,MOSI: 0xFFFFFF;  MISO: 0x197FFF
    0.132685687500000,SPI,MOSI: 0xFFFFFF;  MISO: 0x187FFF
    0.142687562500000,SPI,MOSI: 0xFFFFFF;  MISO: 0x197FFF
    0.152688437500000,SPI,MOSI: 0xFFFFFF;  MISO: 0x187FFF
    0.162690312500000,SPI,MOSI: 0xFFFFFF;  MISO: 0x197FFF
    0.172692187500000,SPI,MOSI: 0xFFFFFF;  MISO: 0x187FFF
    0.182694062500000,SPI,MOSI: 0xFFFFFF;  MISO: 0x197FFF
    0.192695937500000,SPI,MOSI: 0xFFFFFF;  MISO: 0x187FFF
    0.202697812500000,SPI,MOSI: 0xFFFFFF;  MISO: 0x197FFF
    0.212699625000000,SPI,MOSI: 0xFFFFFF;  MISO: 0x187FFF
    0.222701500000000,SPI,MOSI: 0xFFFFFF;  MISO: 0x197FFF
    0.232703375000000,SPI,MOSI: 0xFFFFFF;  MISO: 0x187FFF
    0.242705250000000,SPI,MOSI: 0xFFFFFF;  MISO: 0x197FFF
    0.252707125000000,SPI,MOSI: 0xFFFFFF;  MISO: 0x187FFF
    0.262709000000000,SPI,MOSI: 0xFFFFFF;  MISO: 0x197FFF
    0.272710875000000,SPI,MOSI: 0xFFFFFF;  MISO: 0x187FFF
    0.282711750000000,SPI,MOSI: 0xFFFFFF;  MISO: 0x197FFF
    0.292713625000000,SPI,MOSI: 0xFFFFFF;  MISO: 0x187FFF
    0.302715500000000,SPI,MOSI: 0xFFFFFF;  MISO: 0x197FFF
    0.312717375000000,SPI,MOSI: 0xFFFFFF;  MISO: 0x187FFF
    0.322719250000000,SPI,MOSI: 0xFFFFFF;  MISO: 0x197FFF
    0.332721125000000,SPI,MOSI: 0xFFFFFF;  MISO: 0x187FFF
    0.342723000000000,SPI,MOSI: 0xFFFFFF;  MISO: 0x197FFF
    0.352724875000000,SPI,MOSI: 0xFFFFFF;  MISO: 0x187FFF
    0.362726750000000,SPI,MOSI: 0xFFFFFF;  MISO: 0x197FFF
    0.372728625000000,SPI,MOSI: 0xFFFFFF;  MISO: 0x187FFF
    0.382730500000000,SPI,MOSI: 0xFFFFFF;  MISO: 0x197FFF
    0.392732375000000,SPI,MOSI: 0xFFFFFF;  MISO: 0x187FFF
    0.402734250000000,SPI,MOSI: 0xFFFFFF;  MISO: 0x197FFF
    0.412735062500000,SPI,MOSI: 0xFFFFFF;  MISO: 0x187FFF
    0.422736937500000,SPI,MOSI: 0xFFFFFF;  MISO: 0x197FFF
    0.432738812500000,SPI,MOSI: 0xFFFFFF;  MISO: 0x187FFF
    0.442740687500000,SPI,MOSI: 0xFFFFFF;  MISO: 0x197FFF
    0.452742562500000,SPI,MOSI: 0xFFFFFF;  MISO: 0x187FFF
    0.462744437500000,SPI,MOSI: 0xFFFFFF;  MISO: 0x197FFF
    0.472746312500000,SPI,MOSI: 0xFFFFFF;  MISO: 0x187FFF
    0.482748187500000,SPI,MOSI: 0xFFFFFF;  MISO: 0x197FFF
    0.492750062500000,SPI,MOSI: 0xFFFFFF;  MISO: 0x187FFF
    0.502751937500000,SPI,MOSI: 0xFFFFFF;  MISO: 0x197FFF
    0.512753812500000,SPI,MOSI: 0xFFFFFF;  MISO: 0x187FFF
    0.522755687500000,SPI,MOSI: 0xFFFFFF;  MISO: 0x197FFF
    0.532756500000000,SPI,MOSI: 0xFFFFFF;  MISO: 0x187FFF
    0.542758375000000,SPI,MOSI: 0xFFFFFF;  MISO: 0x197FFF
    0.552760250000000,SPI,MOSI: 0xFFFFFF;  MISO: 0x187FFF
    0.562762125000000,SPI,MOSI: 0xFFFFFF;  MISO: 0x197FFF
    0.572764000000000,SPI,MOSI: 0xFFFFFF;  MISO: 0x187FFF
    0.582765875000000,SPI,MOSI: 0xFFFFFF;  MISO: 0x197FFF
    0.592767750000000,SPI,MOSI: 0xFFFFFF;  MISO: 0x187FFF
    0.602769625000000,SPI,MOSI: 0xFFFFFF;  MISO: 0x197FFF
    0.612771500000000,SPI,MOSI: 0xFFFFFF;  MISO: 0x187FFF
    0.622773375000000,SPI,MOSI: 0xFFFFFF;  MISO: 0x197FFF
    0.632775250000000,SPI,MOSI: 0xFFFFFF;  MISO: 0x187FFF
    0.642777125000000,SPI,MOSI: 0xFFFFFF;  MISO: 0x197FFF
    0.652779000000000,SPI,MOSI: 0xFFFFFF;  MISO: 0x187FFF
    0.662779875000000,SPI,MOSI: 0xFFFFFF;  MISO: 0x197FFF
    0.672781750000000,SPI,MOSI: 0xFFFFFF;  MISO: 0x187FFF
    0.682783625000000,SPI,MOSI: 0xFFFFFF;  MISO: 0x197FFF
    0.692785500000000,SPI,MOSI: 0xFFFFFF;  MISO: 0x187FFF
    0.702787375000000,SPI,MOSI: 0xFFFFFF;  MISO: 0x197FFF
    0.712789250000000,SPI,MOSI: 0xFFFFFF;  MISO: 0x187FFF
    0.722791062500000,SPI,MOSI: 0xFFFFFF;  MISO: 0x197FFF
    0.732792937500000,SPI,MOSI: 0xFFFFFF;  MISO: 0x187FFF
    0.742794812500000,SPI,MOSI: 0xFFFFFF;  MISO: 0x197FFF
    0.752796687500000,SPI,MOSI: 0xFFFFFF;  MISO: 0x187FFF
    0.762798562500000,SPI,MOSI: 0xFFFFFF;  MISO: 0x197FFF
    0.772800437500000,SPI,MOSI: 0xFFFFFF;  MISO: 0x187FFF
    0.782802312500000,SPI,MOSI: 0xFFFFFF;  MISO: 0x197FFF
    0.792803187500000,SPI,MOSI: 0xFFFFFF;  MISO: 0x187FFF
    0.802805062500000,SPI,MOSI: 0xFFFFFF;  MISO: 0x197FFF
    0.812806937500000,SPI,MOSI: 0xFFFFFF;  MISO: 0x187FFF
    0.822808812500000,SPI,MOSI: 0xFFFFFF;  MISO: 0x197FFF
    0.832810687500000,SPI,MOSI: 0xFFFFFF;  MISO: 0x187FFF
    0.842812562500000,SPI,MOSI: 0xFFFFFF;  MISO: 0x197FFF
    0.852814437500000,SPI,MOSI: 0xFFFFFF;  MISO: 0x187FFF
    0.862816312500000,SPI,MOSI: 0xFFFFFF;  MISO: 0x197FFF
    0.872818187500000,SPI,MOSI: 0xFFFFFF;  MISO: 0x187FFF
    0.882820062500000,SPI,MOSI: 0xFFFFFF;  MISO: 0x197FFF
    0.892821937500000,SPI,MOSI: 0xFFFFFF;  MISO: 0x187FFF
    0.902823812500000,SPI,MOSI: 0xFFFFFF;  MISO: 0x197FFF
    0.912825687500000,SPI,MOSI: 0xFFFFFF;  MISO: 0x187FFF
    0.922826500000000,SPI,MOSI: 0xFFFFFF;  MISO: 0x197FFF
    0.932828375000000,SPI,MOSI: 0xFFFFFF;  MISO: 0x187FFF
    0.942830250000000,SPI,MOSI: 0xFFFFFF;  MISO: 0x197FFF
    0.952832125000000,SPI,MOSI: 0xFFFFFF;  MISO: 0x187FFF
    0.962834000000000,SPI,MOSI: 0xFFFFFF;  MISO: 0x197FFF
    0.972835875000000,SPI,MOSI: 0xFFFFFF;  MISO: 0x187FFF
    0.982837750000000,SPI,MOSI: 0xFFFFFF;  MISO: 0x197FFF
    0.992839625000000,SPI,MOSI: 0xFFFFFF;  MISO: 0x187FFF
    1.002841500000000,SPI,MOSI: 0xFFFFFF;  MISO: 0x197FFF
    1.012843375000000,SPI,MOSI: 0xFFFFFF;  MISO: 0x187FFF
    1.022845250000000,SPI,MOSI: 0xFFFFFF;  MISO: 0x197FFF
    1.032847125000000,SPI,MOSI: 0xFFFFFF;  MISO: 0x187FFF
    1.042849000000000,SPI,MOSI: 0xFFFFFF;  MISO: 0x197FFF
    1.052849812500000,SPI,MOSI: 0xFFFFFF;  MISO: 0x187FFF
    1.062851687500000,SPI,MOSI: 0xFFFFFF;  MISO: 0x197FFF
    1.072853562500000,SPI,MOSI: 0xFFFFFF;  MISO: 0x187FFF
    1.082855437500000,SPI,MOSI: 0xFFFFFF;  MISO: 0x197FFF
    1.092857312500000,SPI,MOSI: 0xFFFFFF;  MISO: 0x187FFF
    1.102859187500000,SPI,MOSI: 0xFFFFFF;  MISO: 0x197FFF
    1.112861062500000,SPI,MOSI: 0xFFFFFF;  MISO: 0x187FFF
    1.122862937500000,SPI,MOSI: 0xFFFFFF;  MISO: 0x197FFF
    1.132864812500000,SPI,MOSI: 0xFFFFFF;  MISO: 0x187FFF
    1.142866687500000,SPI,MOSI: 0xFFFFFF;  MISO: 0x197FFF
    1.152868562500000,SPI,MOSI: 0xFFFFFF;  MISO: 0x187FFF
    1.162870437500000,SPI,MOSI: 0xFFFFFF;  MISO: 0x197FFF
    1.172871312500000,SPI,MOSI: 0xFFFFFF;  MISO: 0x187FFF
    1.182873187500000,SPI,MOSI: 0xFFFFFF;  MISO: 0x197FFF
    1.192875062500000,SPI,MOSI: 0xFFFFFF;  MISO: 0x187FFF
    1.202876937500000,SPI,MOSI: 0xFFFFFF;  MISO: 0x197FFF
    1.212878812500000,SPI,MOSI: 0xFFFFFF;  MISO: 0x187FFF
    1.222880625000000,SPI,MOSI: 0xFFFFFF;  MISO: 0x197FFF
    1.232882500000000,SPI,MOSI: 0xFFFFFF;  MISO: 0x187FFF
    1.242884375000000,SPI,MOSI: 0xFFFFFF;  MISO: 0x197FFF
    1.252886250000000,SPI,MOSI: 0xFFFFFF;  MISO: 0x187FFF
    1.262888125000000,SPI,MOSI: 0xFFFFFF;  MISO: 0x197FFF
    1.272890000000000,SPI,MOSI: 0xFFFFFF;  MISO: 0x187FFF
    1.282891875000000,SPI,MOSI: 0xFFFFFF;  MISO: 0x197FFF
    1.292893750000000,SPI,MOSI: 0xFFFFFF;  MISO: 0x187FFF
    1.302894625000000,SPI,MOSI: 0xFFFFFF;  MISO: 0x197FFF
    1.312896500000000,SPI,MOSI: 0xFFFFFF;  MISO: 0x187FFF
    1.322898375000000,SPI,MOSI: 0xFFFFFF;  MISO: 0x197FFF
    1.332900250000000,SPI,MOSI: 0xFFFFFF;  MISO: 0x187FFF
    1.342902125000000,SPI,MOSI: 0xFFFFFF;  MISO: 0x197FFF
    1.352904000000000,SPI,MOSI: 0xFFFFFF;  MISO: 0x187FFF
    1.362905875000000,SPI,MOSI: 0xFFFFFF;  MISO: 0x197FFF
    1.372907750000000,SPI,MOSI: 0xFFFFFF;  MISO: 0x187FFF
    1.382909625000000,SPI,MOSI: 0xFFFFFF;  MISO: 0x197FFF
    1.392911500000000,SPI,MOSI: 0xFFFFFF;  MISO: 0x187FFF
    1.402913375000000,SPI,MOSI: 0xFFFFFF;  MISO: 0x197FFF
    1.412915250000000,SPI,MOSI: 0xFFFFFF;  MISO: 0x187FFF
    1.422917062500000,SPI,MOSI: 0xFFFFFF;  MISO: 0x197FFF
    1.432917937500000,SPI,MOSI: 0xFFFFFF;  MISO: 0x187FFF
    1.442919812500000,SPI,MOSI: 0xFFFFFF;  MISO: 0x197FFF
    1.452921687500000,SPI,MOSI: 0xFFFFFF;  MISO: 0x187FFF
    1.462923562500000,SPI,MOSI: 0xFFFFFF;  MISO: 0x197FFF
    1.472925437500000,SPI,MOSI: 0xFFFFFF;  MISO: 0x187FFF
    1.482927312500000,SPI,MOSI: 0xFFFFFF;  MISO: 0x197FFF
    1.492929187500000,SPI,MOSI: 0xFFFFFF;  MISO: 0x187FFF
    1.502931062500000,SPI,MOSI: 0xFFFFFF;  MISO: 0x197FFF
    1.512932937500000,SPI,MOSI: 0xFFFFFF;  MISO: 0x187FFF
    1.522934812500000,SPI,MOSI: 0xFFFFFF;  MISO: 0x197FFF
    1.532936687500000,SPI,MOSI: 0xFFFFFF;  MISO: 0x187FFF
    1.542938562500000,SPI,MOSI: 0xFFFFFF;  MISO: 0x197FFF
    1.552939375000000,SPI,MOSI: 0xFFFFFF;  MISO: 0x187FFF
    1.562941250000000,SPI,MOSI: 0xFFFFFF;  MISO: 0x197FFF
    1.572943125000000,SPI,MOSI: 0xFFFFFF;  MISO: 0x187FFF
    1.582945000000000,SPI,MOSI: 0xFFFFFF;  MISO: 0x197FFF
    1.592946875000000,SPI,MOSI: 0xFFFFFF;  MISO: 0x187FFF
    1.602948750000000,SPI,MOSI: 0xFFFFFF;  MISO: 0x197FFF
    1.612950625000000,SPI,MOSI: 0xFFFFFF;  MISO: 0x187FFF
    1.622952500000000,SPI,MOSI: 0xFFFFFF;  MISO: 0x197FFF
    1.632954375000000,SPI,MOSI: 0xFFFFFF;  MISO: 0x187FFF
    1.642956250000000,SPI,MOSI: 0xFFFFFF;  MISO: 0x197FFF
    1.652958125000000,SPI,MOSI: 0xFFFFFF;  MISO: 0x187FFF
    1.662960000000000,SPI,MOSI: 0xFFFFFF;  MISO: 0x197FFF
    1.672961875000000,SPI,MOSI: 0xFFFFFF;  MISO: 0x187FFF
    1.682962750000000,SPI,MOSI: 0xFFFFFF;  MISO: 0x197FFF
    1.692964625000000,SPI,MOSI: 0xFFFFFF;  MISO: 0x187FFF
    1.702966500000000,SPI,MOSI: 0xFFFFFF;  MISO: 0x197FFF
    1.712968312500000,SPI,MOSI: 0xFFFFFF;  MISO: 0x187FFF
    1.722970187500000,SPI,MOSI: 0xFFFFFF;  MISO: 0x197FFF
    1.732972062500000,SPI,MOSI: 0xFFFFFF;  MISO: 0x187FFF
    1.742973937500000,SPI,MOSI: 0xFFFFFF;  MISO: 0x197FFF
    1.752975812500000,SPI,MOSI: 0xFFFFFF;  MISO: 0x187FFF
    1.762977687500000,SPI,MOSI: 0xFFFFFF;  MISO: 0x197FFF
    1.772979562500000,SPI,MOSI: 0xFFFFFF;  MISO: 0x187FFF
    1.782981437500000,SPI,MOSI: 0xFFFFFF;  MISO: 0x197FFF
    1.792983312500000,SPI,MOSI: 0xFFFFFF;  MISO: 0x187FFF
    1.802985187500000,SPI,MOSI: 0xFFFFFF;  MISO: 0x197FFF
    1.812986062500000,SPI,MOSI: 0xFFFFFF;  MISO: 0x187FFF
    1.822987937500000,SPI,MOSI: 0xFFFFFF;  MISO: 0x197FFF
    1.832989812500000,SPI,MOSI: 0xFFFFFF;  MISO: 0x187FFF
    1.842991687500000,SPI,MOSI: 0xFFFFFF;  MISO: 0x197FFF
    1.852993562500000,SPI,MOSI: 0xFFFFFF;  MISO: 0x187FFF
    1.862995437500000,SPI,MOSI: 0xFFFFFF;  MISO: 0x197FFF
    1.872997312500000,SPI,MOSI: 0xFFFFFF;  MISO: 0x187FFF
    1.882999187500000,SPI,MOSI: 0xFFFFFF;  MISO: 0x197FFF
    1.893001062500000,SPI,MOSI: 0xFFFFFF;  MISO: 0x187FFF
    1.903002937500000,SPI,MOSI: 0xFFFFFF;  MISO: 0x197FFF
    1.913004750000000,SPI,MOSI: 0xFFFFFF;  MISO: 0x187FFF
    1.923006625000000,SPI,MOSI: 0xFFFFFF;  MISO: 0x197FFF
    1.933008500000000,SPI,MOSI: 0xFFFFFF;  MISO: 0x187FFF
    1.943009375000000,SPI,MOSI: 0xFFFFFF;  MISO: 0x197FFF
    1.953011250000000,SPI,MOSI: 0xFFFFFF;  MISO: 0x187FFF
    1.963013125000000,SPI,MOSI: 0xFFFFFF;  MISO: 0x197FFF
    1.973015000000000,SPI,MOSI: 0xFFFFFF;  MISO: 0x187FFF
    1.983016875000000,SPI,MOSI: 0xFFFFFF;  MISO: 0x197FFF
    1.993018750000000,SPI,MOSI: 0xFFFFFF;  MISO: 0x187FFF
    2.003020625000000,SPI,MOSI: 0xFFFFFF;  MISO: 0x197FFF
    2.013022500000000,SPI,MOSI: 0xFFFFFF;  MISO: 0x187FFF
    

  • Hi Huang,

    I think your MISO and MOSI pins need to be swapped, either from MCU to DAC or on the scope.

    If it is just a typo on the scope and the MISO is actually connected to the DIN of the DAC, the following are the observations:

    1. SPI,MOSI: 0xFFFFFF; MISO: 0x200003 - Power-up DACA and DACB
    2. SPI,MOSI: 0xFFFFFF; MISO: 0x300003 - Make the LDAC pin inactive (this will need software LDAC)
    3. SPI,MOSI: 0xFFFFFF; MISO: 0x187FFF - Write to DACA
    4. SPI,MOSI: 0xFFFFFF; MISO: 0x197FFF - Write to DACB
    5. SPI,MOSI: 0xFFFFFF; MISO: 0x380001 - Enable internal reference

    Please note that you are disabling the LDAC pin functionality. Hence, you need software LDAC. That means you need to use "Update DACx" command after step 4 or step 5 in order to get the output voltage change with respect to the code.

    Please check Table 17 in datasheet for details.

    Hope this fixes your issue. Thank you.

    Regards,
    Uttam
  • Hi Uttam

    i've modify my program and doing test, but it's fail the DAC device can't bring out any voltage change still keep zero voltage

  • Hi Uttam

    i've modify my program and doing test, but it's fail the DAC device can't bring out any voltage change still keep zero voltage
  • Hi Huang,

    Looks like there is some simple mistake either in hardware or measurement. Could you please check the following with a multimeter:

    1. Voltage on pin 9 (AVDD) of the DAC
    2. Voltage on the VREFOUT in after you enable the reference through SPI
    3. SPI signals on the IC pins

    If possible, test it on another board to eliminate any board-specific issue.

    Regards,
    Uttam