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.

TMS570LS1227 ADC questions

Dear TI, Please solving my following questions:

1. In TRM, why it must minus 0.5?

2. In TRM, why the numbers of buffers is twofold?

3. How to trigger ADC by software? Does it mean writing the desired channel to the ADGxSEL?

 

4. I create an example to input 2 analog signals,

adcInit();
	adcStartConversion(adcREG1, adcGROUP1);
	while(1){
		while(adcIsConversionComplete(adcREG1, adcGROUP1) == 0);
		count = adcGetData(adcREG1, adcGROUP1, &adc_data[0]);

		id[0] = adc_data[0].id;
		value[0] = adc_data[0].value;

		id[1] = adc_data[1].id;
		value[1] = adc_data[1].value;
		while(time)	{
			time--;
		}																																																																																																																						while(time){time--;};
	}

But sometimes the result will exchange, the id[0] and value[0] will store second data, not always first data.

Could you explain it? Please have my project.

https://e2e.ti.com/cfs-file/__key/communityserver-discussions-components-files/312/3666.2015_2D00_06_2D00_22_5F00_ADC-Testing.7z

 

  • Hello,

    See answers below:

    1. In TRM, why it must minus 0.5?

    >> This equation reflects the fact that the first code boundary is at 1/2 LSB and not at 1 LSB. The ADC transfer function is essentially shifted 1/2 LSB to the left. See this page for more information about DC offset in an ADC.

    2. In TRM, why the numbers of buffers is twofold?

    >> This was originally done to be able to support a large sized ADC RAM without having to increase the number of bits available to choose the number of buffers available to each group.

    3. How to trigger ADC by software? Does it mean writing the desired channel to the ADGxSEL?

    >> Yes, group1 and group2 are software-triggered groups by default and conversions are started by writing a non-zero value to their respective channel-select registers. 

    4. I create an example to input 2 analog signals,

    adcInit();
    	adcStartConversion(adcREG1, adcGROUP1);
    	while(1){
    		while(adcIsConversionComplete(adcREG1, adcGROUP1) == 0);
    		count = adcGetData(adcREG1, adcGROUP1, &adc_data[0]);
    
    		id[0] = adc_data[0].id;
    		value[0] = adc_data[0].value;
    
    		id[1] = adc_data[1].id;
    		value[1] = adc_data[1].value;
    		while(time)	{
    			time--;
    		}																																																																																																																						while(time){time--;};
    	}

    But sometimes the result will exchange, the id[0] and value[0] will store second data, not always first data.

    Could you explain it? Please have my project.

    >> You have chosen group1 to be in a continuous conversion mode. In this mode the "group conversion end" flag in the status register is only set for 1 VCLK cycle and then gets cleared as the group conversion restarts automatically. In this mode, it is not recommended to poll for the "G1_END" flag in the group1 interrupt flag register. This is also stated in the TRM as part of the description of this bit.

    >> There are several aspects about continuous mode conversions that actually limit the usability of this mode. If you really need to read and process every single conversion result, you should consider switching to a single conversion sequence mode. Then you can periodically trigger this group conversion, poll for the G1_END flag, read out the results and process them (or use an interrupt instead of polling).

    Regards, Sunil

     

  • Hi,

    Hope the above post answers your question, in that case can you pls click verify answer and close this thread ? Thanks.