I am controlling AD5663R D to A Converters using the SPI bus on a BF547 processor. I find the amount of time to write one output code to the AD5663R is slower than I expected and need.
The connections I have now are:
BF547 |
AD5663R |
---|---|
SPIxMOSI | DIN |
SPIxSCK | SCLK |
SPIxSEL1 | ~SYNC |
The AD5663R requires 24 Bits to be sent while its ~SYNC line is set low. Between every 24 Bit send the ~SYNC line is required to go high. The most the BF547 hardware can do is send 16 bits while the SPIxSEL1 is low. On my next board design I will connect the SPIxSEL1 to a TACLKx input and the TMRx output of that counter to ~SYNC. For now I find that it works to, after opening the SPI driver, open the Flag that shares the SPIxSEL1 output, so the ~SYNC line can be controlled with the Flag, while the rest of the interface is still controlled by the SPI driver.
I find the Flag driver to be very fast, and a call to it consumes an insignificant about of time compared to the adi_dev_Write() statement, and so the Flag, besides serving to drive the ~SYNC line, is also useful to measure how long it takes to execute the adi_dev_Write() statement. I have the SPI bus running at its fastest setting, with a ADI_SPI_CMD_SET_BAUD_REG setting of 4. ADI_DEV_CMD_SET_SYNCHRONOUS is set FALSE. I find it is taking 50us to execute the adi_dev_Write() statement to send one 24bit command that writes one output code. Where cclk is 500Mhz and sclk is 100MHz is this a normal amount of time? Or could something be wrong? The need is to continuously update the AD5663R's output code every 5us to 10us.
I am currently using the DMA driver. Would the Interrupt Driver be faster?
I am currently working to combine the two buffers given adi_dev_Write() into one. I not expecting this to save enough time.