I am going to try and work a personal project into my quest for gainful employment using the TLV5621I quad 8 bit DAC in MODE0 to control some special LED lighting I have with my CRESTRON system.
Datasheet found here:
Here's the issue I am having. the device has a 12 bit internal latch - 8 bits data and 4 bits address for the data word and 12 bits for the control word.(the datasheet says 11 bits, but the timing diagram seems to show 12). I want to use the AVR SPI engine, but it outputs only 8 bit bytes. The timing diagrams in the DAC datasheet show 12 bits being clocked in then the EN line pulses LOW.
I am wondering how to get the AVR to conform to this format using the SPI engine. I would prefer NOT to have to bitbang this if at all possible, but based on the datasheet I am thinking there is not going to be much choice as and extra bits I shift are going to be put into the next DAC, potentially screwing that ones output up, or it will mess up the DAC I am updating. Not quite sure.
Since the DAC Data is 12 bits I was thinking about a structure of 6 bytes, but from the timing diagrams it would appear that a short idle time between data blocks occur so this may not be an option. This also does not solve my issue with the control word either.
I do not have any preference of AVR on this one. I was thinking about using my trusty Mega324 but I dont need the I/O....just SPI, a USART and a couple of I/O pins....not as many like the 324 has.
The main reason for going with this part is price. If I can get this to interface to the SPI engine in the AVR great. If not, then I have to decide on going with a 10 bit DAC(overkill) with a 16 bit data/control word and almost 3x the price, or two 8bit dual DACs that also have 16bit data/control words and are combined about $3.00 more(almost worth it just to not have a headache).
Any suggestions on what to do on this one?