AnsweredAssumed Answered

What the maximum correct value for ElementCount field of ADI_DEV_1D_BUFFER?

Question asked by Youri.K on Mar 7, 2010
Latest reply on Mar 15, 2010 by PrasanthR



In my application uses connected to PPI 16-bit parallel ADC, using device drivers and system services library.
To receive data uses a one-dimensional (1D) buffer length of 1 MB. PPI runs in RX mode, no frame syncs, external trigger.


Here is the problem. To configure the port uses the table PPIConfigTable, which contains the value ADI_PPI_CMD_SET_TRANSFER_COUNT_REG of type u16. It conflicts with the length of the field ElementCount in buffer Buffer1D.

What is the number of elements in actually be received, specified in the field ElementCount or in the table PPIConfigTable? If specified in PPIConfigTable, is there any considerations how to overcome this limitation for the mode of reception with single external trigger, without frame syncronization?


For SPORT usually use double buffering. In case of PPI, I am afraid, would not the use of ping-pong buffers technology in data loss, since
"Due to clock domain synchronization in RX modes with no frame syncs, there may be a delay of at least 2 PPI_CLK cycles between when the mode is enabled and when valid data is received. Therefore, detection of the start of valid data should be managed by software."
(from ADSP-BF533 HWR).


------------------ SIMPLIFIED PROGRAM FRAGMENT --------------------------
static fract16 frame[1000000];   // actual data area
static ADI_DEV_1D_BUFFER Buffer1D;  //  1D-buffer
// table of PPI driver configuration values
{ ADI_PPI_CMD_SET_TRANSFER_COUNT_REG,(void *) (1000000 - 1)}, // type u16 !!!

ADI_DEV_DEVICE_HANDLE ppi_handle; // device driver handle


main() {
Buffer1D.Data = frame;
Buffer1D.ElementCount = 1000000;   //  type u32  !!!
Buffer1D.ElementWidth = 2;
Buffer1D.CallbackParameter = 0x12345678;
Buffer1D.pNext = NULL;
adi_dev_Control(ppi_handle, ADI_DEV_CMD_TABLE, (void*)PPIConfigTable);
adi_dev_Read(ppi_handle, ADI_DEV_1D, (ADI_DEV_BUFFER *)&Buffer1D);