Part Number: DAC80004
Hallo everyone
I need some help programming the DAC80004.
I use the SPI-Bus to communicate with the chip.
I use the datasheet www.ti.com/.../dac80004.pdf
I have no problems writing and getting data form the chip.
But I have to update all 4 DAC-channels at one time synchronous.
I tried setting and reseting the LDAC- and the SDO-register.
I tried sending and not sending the LDAC-signal at the end of the message.
I tried to send two messages (2x4byte) in one SYNC-time.
I tried sending LDAC-signal in the middle of the message as it is mentioned at page 8.
I tried using different Command Bits (0-3 Bit D27-D24).
And all of this in combination.
Every time the data is updated after each message (4 bytes).
Is it possible to write in each buffer of each channel first and update it afterwards ???
how dose the correct procedure look like?
one my routine: (I tested is without the leds also)
software LDAC is a byte I can set by my own
uint8_t SPI_send_data(uint8_t v0,uint8_t v1,uint8_t v2,uint8_t v3)
{
uint8_t ret_wert=0;
// ChipSelect auf Lo
CS(Bit_RESET);
UB_SPI2_SendByte(v0);
UB_SPI2_SendByte(v1);
UB_SPI2_SendByte(v2);
ret_wert=UB_SPI2_SendByte(v3);
CS(Bit_SET);
if (softwareLDAC == Bit_SET)
{
LDAC(Bit_RESET);
LDAC(Bit_SET);
}
if (softwareLDAC == Bit_SET)
{
UB_Led_On(LED_GREEN);
UB_Led_Off(LED_RED);
}
else
{
UB_Led_Off(LED_GREEN);
UB_Led_On(LED_RED);
}
return ret_wert;
}
Seding routines. dacCommand can change in it varios ways.
SPI_send_data(dacCommand,0x0F,0xFF,0xF0);
delayms(100);
SPI_send_data(dacCommand,0x1F,0xFF,0xF0);
delayms(100);
SPI_send_data(dacCommand,0x2F,0xFF,0xF0);
delayms(100);
SPI_send_data(dacCommand,0x3F,0xFF,0xF0);
delayms(100);
Init routine
0x08,0x00,0x00,0x02 :enable SDO, retval=0x2
0x04,0xF0,0x00,0x0F :Power on, retval=0x2
0x06,0xF0,0x00,0x0F :update control, retval=0x3e
0x1d,0x00,0x00,0x00 :reading status register, retval=0x7c
0x05,0x00,0x00,0x02 :clear mode register, retval=0x0