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.

CCS/RM48L952: How to clear previous ADC conversion result

Part Number: RM48L952
Other Parts Discussed in Thread: HALCOGEN

Tool/software: Code Composer Studio

Hi,

this is my adc related codes

adcData_t adc_data[10];
uint32 ad,ch_count =0,ad,ad1,ad2;

uint32 ADChex(int i){
gioSetBit(gioPORTB, 0, 1);
while((adcIsConversionComplete(adcREG1,adcGROUP1))==0);
ch_count = adcGetData(adcREG1, adcGROUP1,&adc_data[0]);
ch_count = ch_count;
gioSetBit(gioPORTB, 0, 0);
return adc_data[i].value;
}

void airpr()
{
ad = ADChex(0);
adc2dec = (ad/0x100)*256 + ((ad/0x10)%0x10)*16 + (ad%0x10)*1 ;
HP_Air= (1.5608*adc2dec)/819 - 1.2835;
HP_Air = HP_Air*100;

}

void main(void)
{
_enable_IRQ();
gioInit();
gioSetDirection(gioPORTB, 1);
sciInit();
hetInit();
adcInit();
adcStartConversion(adcREG1,adcGROUP1);

while()

{

airpr();

}

i need to clear previous sample data in the adc registers. how to do it.

i am using halcogen also to configure adc. 

  • Why do you want to clear the ADC result RAM? Typical applications use the FIFO mode to read the ADC results, letting the FIFO keep track of new conversions. There is a test mode that allows writing to the ADC RAM, but it should only be used for test. (Actually using PBIST to test the ADC ram is better.) Here is a snapshot of section 19.9.2 of SPNU503.

  • I have some problem in reading the multiple ADC channels simultaneously. there is a small change in output voltage with the mean difference of +40mV over the period of time. it is creating a lot of impact in my overall result. I am totally using 10 channels. if I connect the digital multimeter to the particular channel the output becomes exact (digital multimeter parallelly connected to ADC input to the controller).  I have tried with different combinations of sampling time and discharge time (that only can able to edit in halcogen).

    different trials exercised:

    1. for discharge time 100ns and the sampling time of 200ns there is no change in output voltage up to 1 volt and if it exceeds 1 volt there is 40mV error added.

    2. for discharge time 400ns and the sampling time of 600ns it gives better result up to 1.5v.

    please check the image below

    what actually is the relation between sampling time and discharge time.