1. Any sample code in C for DAC8568?
2. What SPI mode is used? Is it SPI0 or SPI1?
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.
Howdy Vindhyachal Takniki,
DAC8568 uses a versatile 3-wire serial interface that is compatible with SPI protocol. You can probably query the micro-controller forum for any SPI examples or library files.
Page 7 of the DS illustrates a standard serial write operation. As you may know SPI has 4 different settings, based on the clock phase and polarity. The illustration indicates that the clock polarity can be set to 0 or 1, for a respective base value of low voltage or high. Data is captured on the clock's falling edge.
Therefore, the SPI Clock polarity and phase can either be:
CPOL (Clock polarity) = 0 and CPHA (Clock Phase) = 1
or
CPOL =1 and CPHA = 0
Best Regards,
Matt
I have tried following sequence & it is working on device.
Can you plz check if sequence is correct or not?
void configure_dac8568(void) { /* enable software control of ldac */ __delay_cycles_us(10000); CS_enable(); __delay_cycles_us(100); send_spi_byte(0x06); send_spi_byte(0x00); send_spi_byte(0xff); send_spi_byte(0xff); __delay_cycles_us(100); CS_disable(); /* power up all dac at once */ __delay_cycles_us(10000); CS_enable(); __delay_cycles_us(100); send_spi_byte(0x04); send_spi_byte(0x00); send_spi_byte(0x00); send_spi_byte(0xff); __delay_cycles_us(100); CS_disable(); /* intrenal ref on only when required */ __delay_cycles_us(10000); CS_enable(); __delay_cycles_us(100); send_spi_byte(0x08); send_spi_byte(0x00); send_spi_byte(0x00); send_spi_byte(0x01); __delay_cycles_us(100); CS_disable(); /* full on all data registers */ __delay_cycles_us(10000); CS_enable(); __delay_cycles_us(100); send_spi_byte(0x02); send_spi_byte(0xff); send_spi_byte(0xff); send_spi_byte(0xf0); __delay_cycles_us(100); CS_disable(); }