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.

DAC tlv5619 not showing proper sine wave

Other Parts Discussed in Thread: TM4C123GH6PGE, TLV5619

hey,  i am configuring dac through microcontroller TM4C123gH6pge. but my dac was not showing proper sinosuidal wave( as required).
on testing by outputting different values from the pins, i got the following results:

Decimal          voltage(volts)
value                             

0              0
16           0.024
32           0.060
64           0.14
128         0.24
256         0.48
512         0.96
768         1.5
896         1.7
960         1.8
992         1.9
1024       4.7
1536       4.8
2048       4.9
4095       4.93       

on reaching 1024, the voltage level shoots up to 4.7 volts from ~2 volts.

here is the code to configure and outputting the data:

void dac_dataOut(short int data){
        // PD = PJ7 always high
        // LDAC = PJ6
        // WE = PJ5
        // CS = PJ4
        // D0-3 = PJ0-3
        // D4-11 = PN0-7
            // data .. CS = 0 .. WE = 0 .. wait 13ns .. WE = 1 .. LDAC = 0 .. wait 25ns .. CS = 1 .. LDAC = 1

GPIO_PORTJ_DATA_R |= 0x80;         // PD = PJ7 always high


   
   
    data=0x0600;     //putting different test values here
        GPIO_PORTJ_DATA_R = GPIO_PORTJ_DATA_R & (0xF0 | (data & 0x0F));        //set D0-3
    GPIO_PORTN_DATA_R = data >> 4;                                                                        //set D4-11
    d=(GPIO_PORTN_DATA_R<<4)| (GPIO_PORTJ_DATA_R &0x0F);
   
        GPIO_PORTJ_DATA_R &= ~0x30;         // CS = 0, WE= 0
   
   
            GPIO_PORTJ_DATA_R |= 0x20;             // WE= 1
    GPIO_PORTJ_DATA_R &= ~0x40;         // LDAC = 0
   
    GPIO_PORTJ_DATA_R |= 0x50;             // CS = 1, LDAC = 1

}

other pins: VDD=5V, refin=2V, GND=0V.


so, any idea guys, whats the problem thats causing that discontinuity  at 1024 value?

data=0x0600;
        GPIO_PORTJ_DATA_R = GPIO_PORTJ_DATA_R & (0xF0 | (data & 0x0F));        //set D0-3
    GPIO_PORTN_DATA_R = data >> 4;                                                                        //set D4-11
    d=(GPIO_PORTN_DATA_R<<4)| (GPIO_PORTJ_DATA_R &0x0F);
    
        GPIO_PORTJ_DATA_R &= ~0x30;         // CS = 0, WE= 0
    
    
            GPIO_PORTJ_DATA_R |= 0x20;             // WE= 1
    GPIO_PORTJ_DATA_R &= ~0x40;         // LDAC = 0
    
    GPIO_PORTJ_DATA_R |= 0x50;             // CS = 1, LDAC = 1

  • Howdy Hamza,

    Welcome to the E2E forums! One quick experiment you can try is to directly write the value of 1024 (dec) to the DAC, and verify both the input and output by measuring with a multimeter. The results of this experiment will determine if this is indeed DAC/circuit related or code related. If the result does not match with what you've seen previously then I would suggest that you visit the TM4C forums found at , which can help you modify the code for correct writes.

    If the output voltage is incorrect for the digital input, please provide a schematic and voltage reading of all 12 input pins of TLV5619 device.

    Best Regards,
    Matt