TC1782 12 bit SPI

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
User13528
Level 1
Level 1
Hi

I am trying to use a 16bit dac with 24bit SPI interface AD5689R_5687R
I am using the 1782 SSC1 interface selecting 12bit MSB mode.
I am not using the SLSO pins just an independent chip select

I tried in the end random numbers and get an output but can not the relationship with the register
This might be a general SPI question as I normally use a 8bit or a 16bit register to write to SPI what happens when I use a 24bit do I do 3x 8bit or 2x 12bit

I do need to switch back to a 16bit device afterwards
SSC1_SSOC.reg = 0x00000000; disable 16bit spi device
SSC1_CON.bits.BM = 0xB; // transfer data width is 12 bit
ChipSelect(12); //select device
IO_vResetPin( IO_P0_15 ); // P_CSEL_OE
SSC1_vSendData(first 12bit value);
while(SSC1_STAT.bits.BSY); // BSY is set while a transfer is in progress
SSC1_vSendData(2nd 12bit value);
while(SSC1_STAT.bits.BSY); // BSY is set while a transfer is in progress
IO_vSetPin( IO_P0_15 ); // P_CSEL_OE SYNC line high
SSC1_CON.bits.BM = 0xF; // transfer data width is 16 bit for maindac
SSC1_SSOC.reg = 0x00002000; // load SSC1 slave select output control reenable SLS0O5


Carl

https://www.analog.com/en/products/ad5689r.html?doc=AD5689R_5687R.pdf
0 Likes
3 Replies
cwunder
Employee
Employee
5 likes given 50 likes received 50 solutions authored
You could use 8-bit transfer and perform three of them. If you keep the transmit buffer full it will look like one continuous transfer which means you can use the automatic chip select.
0 Likes
User13528
Level 1
Level 1
I changed to 8 bit mode and it worked also eventually used just chip select rather than slave select.
Part of my problem may have been damaged devices I probably overheated them on install awaiting more to retry.
As they were dacs perhaps the resistor ladder was damaged I was getting a strange non-linear response but eventually one of the boards worked perfectly.
I have not tried 12bit again as 8bit would be easier to use anyway
0 Likes
User14049
Level 3
Level 3
How SSC1_SSOC.reg = 0x00002000; work can you help me with that.
0 Likes