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.

DAC161S997EVM: Initialization fail, not firmware

Part Number: DAC161S997EVM
Other Parts Discussed in Thread: DAC161S997

Hi  I want develop a RS485-4_20mA interface with the DAC161S997EVM, but i can´t put a new  current value in the output of DA161S997, but I suspect that  i do not start properly the DAC, can you help me?  

my step to start the DAC is

a) Setup DAC161

b) Delay 

c) Set initial output

Every second refresh output with the same value or new value (modubus rs485 Value)

  • Hi Miguel,

    My colleague Garrett will be able to help you tomorrow.

    Thanks!
    Paul
  • Hello Miguel,

    In the default configuration after start up you should be able to directly write to the DACCODE register (0x04) to set the DAC output. This is done by transmitting a 24bit SPI frame with the upper 8 bits being the register address and the lower 16 are data to write to the register.

    I do see an issue with your update rate with default register values. By default the device expects a SPI write every 100ms set by the SPI_TIMEOUT register. If it does not receive a write during this time it will go to error current values set by the ERRLVL pin. Since you are writing to the device every second this error will occur and will likely appear like the device does not change it's output. To avoid this either set MASK_SPI_ERR so the SPI timeout will not affect the loop current or write NOP to the device at intervals less than the timeout values set by SPI_TIMEOUT register.

    If this does not resolve the issue there could be a problem with your hardware setup or SPI frames. If possible please provide the schematic and SPI waveforms that include SDO, SCLK, and CS for each write on one scope capture.

    Thanks,
    Garrett
  •  Hi Garret

    I am using the DAC161S997EVM

    the  star code is

    **

       DAC_CS_PORTOUT |= DAC_CS_N;     // Active Low, so set high

       DAC_CS_PORTDIR |= DAC_CS_N;

       USCIB0_setupMasterSPI();

       P2DIR &= ~(DAC_ERROR_N );       // Input Pins

       P2IES |=  (DAC_ERROR_N );       // High to Low Edge

       P2IFG &= ~0xFF;                 // Clear any pending interrupts

       P2IE  |=  (DAC_ERROR_N );

       Setup_DAC161  (DAC161_STD_ERR_CONFIG_MASKED, 3370, 21800);;

       DAC161_Set_Out_Value (0);

    **

    // DAC161_STD_ERR_CONFIG_MASKED

    #define DAC161_STD_ERR_CONFIG_MASKED        (DAC161_DISABLE_RETRY_LOOP + DAC161_LOOP_ERR_MAINTAIN_DACCODE + DAC161_LOOP_ERR_DO_NOT_DRIVE_ERRB + DAC161_MASK_SPI_ERR + DAC161_MASK_SPI_TIMEOUT)

    **********************************************************************************

    the Setup  SPI Master routine

    void USCIB0_setupMasterSPI(void)

    {

    DAC_USCIB0_PORTSEL |= (USCIB0_SIMO + USCIB0_SOMI+ USCIB0_CLK);             /

    DAC_USCIB0_PORTSEL2 |= (USCIB0_SIMO + USCIB0_SOMI+ USCIB0_CLK);

    DAC_CS_PORTOUT |= DAC_CS_N;

    DAC_CS_PORTDIR |= DAC_CS_N;

    UCB0CTL1 |= UCSWRST;                                                       // Enable SW reset

    UCB0CTL0 |= (UCMST + UCMSB + UCSYNC + UCCKPH);                          

    UCB0CTL1 |=  UCSSEL_2;                                                     //SMCLK=16 Mhz

    UCB0BR0 = 8;                                                               // SMCLK/8 = SCLK (2MHz)

    UCB0BR1 = 0;

    UCB0CTL1 &= ~UCSWRST;                                                      // Clear SW reset, resume operation

    }

    We modified the firmware of  DAC161S997EVM  to control of DAC161S997   but we can`t  control de output . The figure shows the unique value powered by EVM

  • Hi Miguel,

    Were you able to control the loop current with the EVM software? This would verify your hardware setup. How are you connecting loop+ and loop- and how is the additional board connected?

    Are you able to read back the registers you have written? It would be helpful if you could provide SPI scope captures that include SCLK,SDO,and CSB to ensure the SPI frames are correct.

    Thanks,
    Garrett
  • Hi Miguel,

    Do you have any update on this?

    Thanks,
    Garrett