Got my first code going with a DAC.
Is there anything more I can do to speed this up a little?
Driving 4 of these with 2 outputs each.
Not going for audio quality here, will be remoting the voltage level of some pots.
That would be confirmed by the screenshot of the logic analyzer. It takes 10.5 uS to send out one 16-bit value. That sounds about right as I reckon a single SPI byte to be about 3 uS, plus turning SS on and off. So that sounds OK, you can't do much better than that. Then another 5.5 uS for adding, and the loop etc. Total of 16 uS.
Now you are doing 4096 values up and 4096 values down to get one cycle. So 8192 * 16 uS = 131072 uS.
So your frequency is going to be 1 / 0.131072 which is 7.629 Hz, which exactly agrees with the observed frequency.
To speed it up? You could add more each time (eg. add 2 on the way up, subtract 2 on the way down).
But for remoting pots, well responding within 1/7th of a second is OK isn't it? But as I said, if you want faster, just add more each time. Of course, if you just want to jump from a setting of 500 to a setting of 1000 (with no intermediate steps) then that will take you 16 uS.
5.0 SERIAL INTERFACE
Refer to Figure 1-1 and SPI Timing Specifications Table for detailed input and output timing specifications for both Mode 0,0 and Mode 1,1 operation.
Off to Figure 1-1... The timing diagram includes the SCK signal with the high level labeled tHI and the low level labeled tLO. In the table above the diagram tHI and tLO both have a minimum value of 15 ns. 1 / ((15+15) * 10e-9) = 3,333,333 MHz.
I realize chip vendors publish guaranteed numbers but, assuming I'm reading the datasheet correctly, 8 MHz is more than twice the maximum bitrate.