This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

TMS570LC4357: ADC DMA

Part Number: TMS570LC4357

Hi All, 

I am using a single ADC1-Channel which is HW-triggered by HET. The conversion results are transfered by DMA to a RAM buffer. Right now the RAM buffer is 32-Bit wide, I'd like to decrease it to 16-Bit and transfer the conversion results (max. 12-Bit) into that buffer. 

I am not sure how to setup my DMA controll packet to get the job done, it looks like this now:

adc1_dmaCTRLPKT.SADD = (CPU_INT32U)(&adcREG1->GxBUF[adcGROUP1]); //source address for DMA is ADC1 GP1 FIFO
adc1_dmaCTRLPKT.DADD = (CPU_INT32U)ADC1_GP1_Buffers; //destination address
adc1_dmaCTRLPKT.CHCTRL = 0;
adc1_dmaCTRLPKT.FRCNT = 1000; //frame count -> 1000 ADC samples
adc1_dmaCTRLPKT.ELCNT = 1; //one ADC channel
adc1_dmaCTRLPKT.ELDOFFSET = 0; //element destination offset
adc1_dmaCTRLPKT.ELSOFFSET = 0; //element source offset
adc1_dmaCTRLPKT.FRDOFFSET = 0; //frame destination offset
adc1_dmaCTRLPKT.FRSOFFSET = 0; //frame source offset
adc1_dmaCTRLPKT.PORTASGN = 4; //for ALL TMS570 PORTB; value Port Assignment Register for channel is always 0x100
adc1_dmaCTRLPKT.RDSIZE = ACCESS_32_BIT; //read size
adc1_dmaCTRLPKT.WRSIZE = ACCESS_16_BIT; //write size
adc1_dmaCTRLPKT.TTYPE = FRAME_TRANSFER; //transfer type - FRAME_TRANSFER/BLOCK_TRANSFER
adc1_dmaCTRLPKT.ADDMODERD = ADDR_FIXED; //address mode read
adc1_dmaCTRLPKT.ADDMODEWR = ADDR_INC1; //address mode write: ADDR_FIXED/ADDR_INC1/ADDR_OFFSET
adc1_dmaCTRLPKT.AUTOINIT = AUTOINIT_ON; //autoinit

setting adc1_dmaCTRLPKT.WRSIZE to ACCESS_16_BIT doesn't really work, the buffer looks like this then:

Is it possible to transfer only the data part (lower 16-Bits) of the ADC FIFO into a 16-Bit buffer?

Best Regards,
Juergen