This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

ARMLPC 2148 ADC SAMPLING RATE

I done this code for ADC its doing the conversion well ., Now I want to sample the ADC values ,
This is my code .
In this code where I want to sample .
In which place I want do sample.
How to sample the coversion of ADC.

AD1CR&=0X00000000;// clear AD1CR AD1CR|=0X00000003;// select AD1.0....ad1.1as Ain AD1CR|=0X00010000;// select BURST mode (11clk/10bit) AD1CR|=0X00200000;// PDN in operational mode AD1CR|=0X00000400;// CLKDIV=4,to set adclk<4mhz

void adc0() { adcdata=AD1DR0; // move the RESULT0(Vin/Vref) to adcdata while((AD1DR0&0X80000000)==0);//check for the done bit

adcdata=((adcdata>>6)&0x03FF);

stepsize=3.22; // stepsize = Vref/resolution //(3.3/1024=0.00322 (or)3.22x10^-3) (for 10 bit adc) dout=((adcdata*1000000)/stepsize);
// dout=((adcdata)*0.00322); c=c+1; if(c==15) { calculate0(dout); c=0; } }

Parents Reply Children
No data