Quantcast
Channel: Forums - Recent Threads
Viewing all articles
Browse latest Browse all 262198

DAC8760: DAC8760 interfacing with PSOC4 through Hardware SPI

$
0
0

Part Number:DAC8760

Hi,

        I need help in both hardware and Software. We have designed the board with PSOC 4 and DAC8760 to provide DAC output. But while Checking we got 700 milli Voltage from Refout Pin (which in turn connected to Refin pin). Can we give 5V directly to Refout Pin???

And below I have pasted my code in which the program uses Hardware SPI, even checked with the Oscilloscope that I have transmitted data Successfully but while attempting to read Can't read any data from register.

#include "project.h"
#include "stdio.h"

int main(void)
{
   
    int i=0,x,y;
    char str[10];
    CyGlobalIntEnable;
   
    SPI_Initialise();
   
    //SPI_1_SpiSetActiveSlaveSelect(SPI_1_SPI_SLAVE_SELECT0);
    //Slave Select as Seperate Pin SS_2
    //Resetting DAC8760
    SS_2_Write(1);
    SPI_1_SpiUartWriteTxData(0x56);
    CyDelayUs(SPI_Delay);
    SPI_1_SpiUartWriteTxData(0x00);
    CyDelayUs(SPI_Delay);
    SPI_1_SpiUartWriteTxData(0x01);
    CyDelayUs(50);
    SS_2_Write(0);
    CyDelayUs(SPI_Delay);
   
   
    //Writing First Initial data to DAC Data Register
    SS_2_Write(1);
    Clear_Write(1);
    SPI_1_SpiUartWriteTxData(0x01);
    Clear_Write(0);
    CyDelayUs(SPI_Delay);
    SPI_1_SpiUartWriteTxData(0x00);
    CyDelayUs(SPI_Delay);
    SPI_1_SpiUartWriteTxData(0x00);
    CyDelayUs(50);
   
    SS_2_Write(0);
   
    // Writing to the Control Register for 0 to 10 V Output
   
    SS_2_Write(1);
    SPI_1_SpiUartWriteTxData(0x55);
    CyDelayUs(SPI_Delay);
    SPI_1_SpiUartWriteTxData(0x10);
    CyDelayUs(SPI_Delay);
    SPI_1_SpiUartWriteTxData(0x01);
    CyDelayUs(50);
    SS_2_Write(0);
   
   
    CyDelay(1000);
   
   
    for(;;)
    {
        //Writing 10V Data to the DAC data Register
       
        SS_2_Write(1);
        Clear_Write(1);       
        SPI_1_SpiUartWriteTxData(0x01);
        Clear_Write(0);
        SPI_1_SpiUartWriteTxData(0xFF);
        SPI_1_SpiUartWriteTxData(0xFF);
        CyDelayUs(50);
        SS_2_Write(0);
        CyDelay(1000);
       
        //Writing 5V Data to the DAC data Register       
       
        SS_2_Write(1);
        Clear_Write(1);       
        SPI_1_SpiUartWriteTxData(0x01);
        Clear_Write(0);
        SPI_1_SpiUartWriteTxData(0x7F);
        SPI_1_SpiUartWriteTxData(0xFF);
        CyDelayUs(50);
        SS_2_Write(0);    
        CyDelay(1000);
    }
}

Thank You.


Viewing all articles
Browse latest Browse all 262198

Trending Articles