AnsweredAssumed Answered

adi_dev_Control() Returns Invalid Sequence of Commands

Question asked by spflanze on Jan 17, 2013
Latest reply on Jan 17, 2013 by spflanze

My call to adi_dev_Control() is returning error code 0x4000000a which is "Invalid Sequence of Commands". Below are the relevant code fragments. It is for an AD7606 A to D converter:

 

ADI_DEV_CMD_VALUE_PAIR EPPI_ADC_SETUP[] = {

    // Common Commands

    { ADI_DEV_CMD_SET_DATAFLOW, (void *)FALSE }, //  Enables/disables dataflow through the device

    { ADI_DEV_CMD_SET_SYNCHRONOUS, (void *)FALSE }, // The DMA channel's FIFO might have data between descriptors.

    { ADI_DEV_CMD_SET_DATAFLOW_METHOD, (void *)ADI_DEV_MODE_CHAINED_LOOPBACK  }, // Data will rotate around one buffer.

    { ADI_DEV_CMD_SET_INBOUND_DMA_CHANNEL_ID, (void *)ADI_DMA_DMA13 }, // The DMA Channel for BF547's EPP1

    { ADI_DEV_CMD_GET_INBOUND_DMA_INFO, &adc_dma_info }, // Gets Inbound DMA channel Information

    { ADI_DEV_CMD_OPEN_PERIPHERAL_DMA, &adc_dma_info }, // Device manager opens a DMA channel for the peripheral

    { ADI_EPPI_CMD_SET_SAMPLES_PER_LINE, (void *)ADC_CHAN_N }, // Sets EPPI Samples Per Line Register

    { ADI_EPPI_CMD_SET_PORT_DIRECTION, (void *)0 }, // 0 - EPPI in Receive mode (input) 1 - EPPI in Transmit mode

    { ADI_EPPI_CMD_SET_TRANSFER_TYPE, (void *)0x3 }, // 0b11 - Non-ITU-R 656, GP Only

    { ADI_EPPI_CMD_SET_FRAME_SYNC_CONFIG, (void *)0x1 }, // 0b01 - GP 1 FS Mode

    { ADI_EPPI_CMD_ENABLE_BLANKGEN, (void *)0 }, // 0 - Disabled

    { ADI_EPPI_CMD_ENABLE_INTERNAL_CLOCK_GEN, (void *)TRUE }, // 1 - Enabled (generated internally)

    { ADI_EPPI_CMD_ENABLE_INTERNAL_FS_GEN, (void *)FALSE }, // 0 - Disabled (FS supplied externally) (From AD7606 BUSY output)

    { ADI_EPPI_CMD_SET_CLOCK_POLARITY, (void *)0x2 }, // 0b10 - Sample data on rising edge and sample/drive syncs on falling edge

    { ADI_EPPI_CMD_SET_FRAME_SYNC_POLARITY, (void *)0x1 }, // FS1 Active low/ starts out high

    { ADI_EPPI_CMD_SET_DATA_LENGTH, (void *)0x4 }, // DLEN (Data Length) 0b100 - 16 bits

    { ADI_EPPI_CMD_SET_SKIP_ENABLE, (void *)FALSE }, // For Receive mode Only, 0 - Skipping disabled

    { ADI_EPPI_CMD_SET_PACK_UNPACK_ENABLE, (void *)TRUE }, // Enable EPPI DMA packing/unpacking

    { ADI_EPPI_CMD_SET_SWAP_ENABLE, (void *)FALSE }, //  Enable Data swapping

    { ADI_EPPI_CMD_SET_SPLIT_EVEN_ODD, (void *)0 }, // Enable sub-split odd samples

    { ADI_EPPI_CMD_SET_DMA_CHANNEL_MODE, (void *)0 }, // 0 - One Channel mode

    { ADI_EPPI_CMD_SET_FIFO_REGULAR_WATERMARK, (void *)0x2 }, // 10 - FIFO 50% Full

    { ADI_EPPI_CMD_SET_FIFO_URGENT_WATERMARK, (void *)0x1}, // 01 - FIFO 75% Full

    { ADI_EPPI_CMD_SET_HORIZONTAL_DELAY, (void *)ADC_EPPI_HORIZONTAL_DELAY },

    { ADI_DEV_CMD_END, NULL }

};

 

Result = adi_dev_Control( ADC_EPPI_handle, ADI_DEV_CMD_TABLE, (void *)EPPI_ADC_SETUP ) );

 

What is out of sequence here?

Outcomes