put delay inside adc(), will be correct way. counting outside, meaningless ----- Original Message ----- From: "apptech" To: "Microcontroller discussion list - Public." Sent: Sunday, November 23, 2008 6:54 AM Subject: [PIC] PIC ADC Sampling Rate > Swallowed by list manager - reason unknown: > > > From: "Amrish" > To: > Sent: Sunday, November 23, 2008 11:57 AM > Subject: [PIC] PIC ADC Sampling Rate > > > > > Hi all, > > We are using the following code to read the adc value from the PIC using > > Internal clock frequency. > > for(i=0;i<50000;i++) > { > a = read_adc(); > printf("%lu",a); > } > > The above code snippet takes > 200s to execute and I am unable to acheive > > the sampling rate of around 10,000 samples/s. Is this the right way to > > sample analog signals using PIC? > > *** We are using PIC to perform ADC on sound waves sensed using > > microphone. > > -Amrish > -- > View this message in context: > http://www.nabble.com/PIC-ADC-Sampling-Rate-tp20641430p20641430.html > Sent from the PIC - [PIC] mailing list archive at Nabble.com. > > -- > http://www.piclist.com PIC/SX FAQ & list archive > View/change your membership options at > http://mailman.mit.edu/mailman/listinfo/piclist __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist