Need some help formatting and sending commands to TLV5618 DAC

Hi,

I would be very grateful if someone with much more skill than me could take a look at the datasheet for the TLV5618 serial DAC here and tell me exactly what they would clock out of a microcontroller to set the output of 'A' to 0, 2.5, and 5V?

formatting link

I've been trying to do this for a week or two, and I can't seem to get the DAC to respond to my commands correctly. The output changes, but often not as I would expect, and sometime gets 'stuck' on certain values for a number of update cycles.

You might need to show me the bit order, as I think that my shiftOut routines aren't presenting the data correctly.

Assuming 2.048v on Vref

Steve

Reply to
Kasterborus
Loading thread data ...

Are you sending the 17-th edge? You don't mention which micro you're using but I'll assume it's a typical one with a built-in 8-bit SPI. After you send the two 8-bit bytes that make up the command and data to the DAC, it looks like you will need to separately drive the clock line once for a positive edge before un-asserting ~CS. Different micros make it more or less cumbersome to take control of a pin that has been previously assigned to a peripheral function.

Pay attention to the setup and hold times, as well.

The bit order on the SPI line will be MSB sent first.

0 1000 0000 0000 0000 2.5 1000 1001 1100 0100 5 can't be done with a Vref of 2.048
Reply to
Rich Webb

Thanks for the reply.

Yes you are quite right, and I noticed the error after I posted -

4.096v not 5v.

I'm actually using the Arduino Decimilia board (easy for newbies like me) - and I've coded my own function for ShiftOut using 3 pins, SCLK, DOUT, and CS. This way I get complete control over the output.

I'll look into the 17th edge tomorrow and see what I come up with.

It's been rather frustrating working with the chip - I ended up making an 8-bit DAC out of a 595 and R-2R ladder. This works fine, but I'd rather use the 12bit chip if I can.

Reply to
Kasterborus

If you can, look at the ~CS, clock, and data lines while they're active. I've coded some bit-banged SPI interfaces myself in the past and have made the occasional head-slapper mistake. Ensure that you're changing the data lines at or near the rising edge of CLK, so that the data lines are all stable on the falling edge.

Reply to
Rich Webb

I haven't use that number but one that programs in the same fashion. the pic I had did not support 16 bit SPI.. I hard coded the sequence via an interrupt. And you send the MSB first in the data which will be the control bits then follows the data bits downwards to the LSB data bit..

--
"I\'m never wrong, once i thought i was, but was mistaken"
Real Programmers Do things like this.
http://webpages.charter.net/jamie_5
Reply to
Jamie

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.