Hi,
I have msp-exp432p4111 and DAC161s997 and using the firmware of TIDA-00648
Setup_DAC161 (DAC161_STD_ERR_CONFIG_MASKED, 0, 21800); DAC161_Set_Out_Value(x* 2730);
x is the mA value which i want to get but lets say x =5 , then output is become something like 2.5mA. if i use 5400 instead of 2730 then output is normal until 8mA after that output changes slower like if x=15 then output is 9mA.
void USCIB0_setupMasterSPI(void) { DAC_USCIB0_PORTDIR |= (USCIB0_SIMO + USCIB0_SOMI+ USCIB0_CLK); DAC_USCIB0_PORTSEL |= (USCIB0_SIMO + USCIB0_SOMI+ USCIB0_CLK); // Assign SPI pins to Primary Peripheral of USCI_B0 DAC_CS_PORTOUT |= DAC_CS_N; DAC_CS_PORTDIR |= DAC_CS_N; EUSCI_B0->CTLW0 |= EUSCI_B_CTLW0_SWRST; // Enable SW reset EUSCI_B0->CTLW0 |= (EUSCI_B_CTLW0_SWRST + EUSCI_B_CTLW0_MST + EUSCI_B_CTLW0_MSB + EUSCI_B_CTLW0_SYNC + EUSCI_B_CTLW0_CKPH ); // SPI Master, 3 wire, synchronous mode EUSCI_B0->CTLW0 |= EUSCI_B_CTLW0_SSEL__SMCLK; // SMCLK EUSCI_B0->BRW = 8; EUSCI_B0->CTLW0 &= ~EUSCI_B_CTLW0_SWRST; // Clear SW reset, resume operation } void Setup_DAC161 (unsigned short errConfig, unsigned short errLow_uA, unsigned short errHigh_uA) { unsigned short errValue; DAC161_Write_Regs (&errConfig, DAC161_ERR_CONFIG_REG, 2); errValue = DAC161_CONVERT_ERR_VALUE(errLow_uA) & 0x7f00; DAC161_Write_Regs (&errValue, DAC161_ERR_LOW_REG, 2); errValue = DAC161_CONVERT_ERR_VALUE(errHigh_uA) & 0xff00; if (errValue < 0x80) errValue = 0x80; DAC161_Write_Regs (&errValue, DAC161_ERR_HIGH_REG, 2); }