ΣSigmaStudio Ask AI Русский Log in

Bf609 and ad4001 spi comminication problem

Processors & DSP AhmetB. Nov 14, 2017 00:00 4 replies Original on forum ↗
Subscribe
AhmetB. Question
Nov 14, 2017 00:00

hi;
i'm working on BF609 Dsp and Ad4001(adc chip) . i try to connect them with spi . partly i achived but i have some problems
My first problem is that: i couldn't recive 2Msps continous data. i read spi device driver manual in CCES 2.6 for Bf60x spi but i couldn't find any appropriate mode for ad4001.
My spi configuration are below:
/* transceiver buffers */
uint8_t TxBuffer;
uint8_t RxBuffer[2];
ADI_SPI_HANDLE hDevice;
/* transceiver configurations */
ADI_SPI_TRANSCEIVER Transceiver1 = {NULL, 0, NULL, 0, &RxBuffer[0], 2};
adi_spi_Open(1, SPIDriverMemory, (uint32_t)ADI_SPI_DMA_MEMORY_SIZE, &hDevice);
adi_spi_SetSlaveSelectDelay(hDevice,false,false,3);
adi_spi_SetLsbFirst(hDevice,false);
adi_spi_SetMaster(hDevice, true);
adi_spi_SetHwSlaveSelect(hDevice, false);
adi_spi_SetTransmitUnderflow(hDevice, false);
adi_spi_SetClockPhase(hDevice, false);
adi_spi_SetClock(hDevice, 7);// sclk0,sclk1 and sck=250Mhz
adi_spi_SetSlaveSelect(hDevice, ADI_SPI_SSEL_ENABLE1);
adi_spi_SetWordSize(hDevice, ADI_SPI_TRANSFER_16BIT);
adi_spi_ManualSlaveSelect(hDevice,false);
di_spi_SetRxWatermark(hDevice,ADI_SPI_WATERMARK_50,ADI_SPI_WATERMARK_DISABLE,ADI_SPI_WATERMARK_DISABLE);
adi_spi_RegisterCallback(hDevice, SpiCallback, NULL)
adi_spi_EnableDmaMode(hDevice, true);
adi_spi_SetDmaTransferSize(hDevice, ADI_SPI_DMA_TRANSFER_16BIT);

and i always have to write this comment to start spi for data transfers "adi_spi_SubmitBuffer(hDevice, &Transceiver1);" But "adi_spi_SubmitBuffer" takes 4u second and i couldn't find anyway to trig spi transfers without submitBuffer function . i tried "adi_spi_ConfigRxTrigger" but result is same i have to always write SubmitBuffer function. And i attached my c code "Ccode1"

Second problem : CS (Yellow) timing when i use 35MHz SpiClk (Green) and 1Mhz SpClk , it has very unstable characteristic. i couldn't find any reason , i'm sharing screenshots "Picture1"=35mhz SpiClk , "Picture2"=1mhz SpiClk. Related code about that "Ccode1.c" and SlaveSelect has controled by Spi, not manuel. And i also tried manel spi_cs(Slevselect) , İ'm sharing result "Picture3"=35mhz spiclk and "Picture4" 1Mhz spiclk and related code "Ccode2".

ADIApproved Reply
Nov 16, 2017 00:00

Hi,

Can you please try with our example available in ADSP-BF609 EZ Kit Board Support Package

You can download "ADSP-BF609 EZ Kit Board Support Package" from the below link:
http://www.analog.com/en/design-center/evaluation-hardware-and-software/evaluation-boards-kits/eval-bf609-ez.html#eb-relatedsoftware

After successful installation of BSP, you can get example for SPI in the below path:
<Installation path>\ADSP-BF609_Evaluation_Board-Rel1.1.0\BF609_EZ-Board\Blackfin\Examples\drivers\spi

Regards,

Kader

AhmetB. Reply
Nov 20, 2017 00:00

Hi
I have already studied the examples.But i couldn't see any continuous mode dma example.. Do you have c code driver for ad4001

ADIApproved Reply
Nov 21, 2017 00:00

Hi,

Please find the attached SPI example with DMA mode. As per our understanding we do not have any drivers for ad4001.

Regards,

Kader

EZAdministrator Reply
Aug 2, 2018 00:00

This question has been assumed as answered either offline via email or with a multi-part answer. This question has now been closed out. If you have an inquiry related to this topic please post a new question in the applicable product forum.

Thank you,
EZ Admin