AnsweredAssumed Answered

Problem with SPI ADC/DAC.

Question asked by khal on Oct 13, 2011
Latest reply on Nov 13, 2011 by DeepV


I have written a program that reads the data from the ADC via SPI and write the data received to the DAC via SPIB (both SPI and SPIB are on the SHARC 21479. While I am sure the ADC-SPI side is fine (as I can see my expected sinusoid in my buffer), I could not see the received data at the output of the DAC. The difference between the two is the I have one chip ADC and a quad-DAC chip (AD5544). The ADC therefore requires on 16 SPI clocks to transfer a valid data from the ADC to the SHARC. Whereas the DAC requires 2-extra clock cycles (i.e. in addition to the 16 data SPI clocks) in order to send the DAC select (i.e. since there are 4-DAC, I need to make sure I select the right DAC where my output is connected). For the reason, my ADC-SPI WL (word length) is 16, whereas for the DAC it has to be 32 since there is no fine setting for the SPI WL (one can only select 8,16 or 32). As the DAC is expecting 18-bits and I am sending 32 clocks, I assummed that if the bottom 18 are the necessary ones and zero the top 14-bits of the 32-bit word I am sending, I thought it would work (assuming that I right MSB first). The signal reach the DAC correctly but the DAC does not respond to the data I am writing. I am not sure that writing 32 bits is correct when it is looking for 18 bits. AD5544 suggest that it should be able to work in SPI mode, and therefore the confusion. What have I done wrong in the code?


Many thanks.




PS: I have the same DAC working with SPORT setup which allows to clocks equal to 18-bits.