AnsweredAssumed Answered

different blocks containing different data to different DAC's (+DMA)

Question asked by Didier on Mar 10, 2010
Latest reply on Mar 11, 2010 by Didier



For a project I am using a 21369 EZ Lite evaluation board, but I'm having trouble with sending differerent data to different DAC's. I have been using the block-based talkthrough example and modified it here and there for my needs to output a sinewave on DAC4. I used DMA chaining and TCB's for that (removed the one for the ADC, since the blocks were being filled differently) and filled my block with the sinewave values.

Now what I would like to have is to output sinewaves of different frequencies to different DAC's.But I'm a bit confused with the transfer control blocks.


I have created a structure to hold data for let's say 4 different sinewaves in the following way:


typedef struct{
    float ch1[NUM_SAMPLES];          //NUM_SAMPLES = 10
    float ch2[NUM_SAMPLES];

    float ch1[NUM_SAMPLES];
    float ch4[NUM_SAMPLES];   
} data;


data block;


I then fill these blocks with my sinewavetable values (1024 samples) using lineair interpolation depending on what frequency I would like to have.

After these blocks are filled I would like to send for instance block.ch1 to the output of DAC1, block.ch2 to DAC2, etc.

The problem is that in the original block-based talkthrough you would have something like:


    //Proceed from Block B to Block c
    TCB_Block_B[0] = (int) TCB_Block_C + 3 - OFFSET + PCI ;
    TCB_Block_B[3] = (unsigned int) Block_B - OFFSET ;


    //Proceed from Block C to Block B
    TCB_Block_C[0] = (int) TCB_Block_B + 3 - OFFSET + PCI ;
    TCB_Block_C[3] = (unsigned int) Block_C - OFFSET ;


and then send C to DAC4:


#ifdef DAC4
    // write to DAC4
    *pCPSP2B = (unsigned int) TCB_Block_C - OFFSET + 3;


and in the main you would select your block with:


unsigned int *src_pointer[2] = {Block_B,








If possible I would like to know how my TCB's should look like and how many of them I should have.

Because i want to send all blocks at the same time to the DAC's. Do I even need to use chaining at all then?