Problem: ADC with microphone input (PIC18F4550)

Status
Not open for further replies.
An LM386 power amplifier circuit works perfectly when it is built with all the important parts on a pcb. It might oscillate if it is built all spread out or built on a breadboard.

but o'm juz trying to light 3 LEDs according to the sound level...would the oscillation affect it so much? ..im hoping to finish prototyping bfore doing it on da PCB
 
A breadboard doesn't work for high frequency circuits because its capacitance is much too high. The LM386 audio amplifier has plenty of gain at 1MHz so it needs to be soldered on well designed stripboard or on a pcb.
 
hey guyz...merry christmas!

played around with da coding today and found out ONE of the prob....i've configured the ADC wrongly (A/D Conversion Clock Select bits = Fosc/2) .... changed it to Fosc/8 and it works fine (for DC inputs ha ha ha-.-)

do u all know about the "A/D Acquisition Time" and "A/D Conversion Clock" ? what would be the ideal configuration for my current circuit? ....i've tried reading the datasheet of the PIC and did not understand these.... would be most grateful for any links for me to read up on these
 
A breadboard doesn't work for high frequency circuits because its capacitance is much too high. The LM386 audio amplifier has plenty of gain at 1MHz so it needs to be soldered on well designed stripboard or on a pcb.

yea i guess ill will spend some time on a small PCB for the amplifier if da oscillation is affecting my readings...thx AudioGuru
 
hey guys good news!

finally FINALLY found out wad was wrong with my circuit...it wasn't the hardware...but the software !!

this part:
Code:
OpenADC( ADC_FOSC_8 	& 
		 ADC_RIGHT_JUST &
		 ADC_8_TAD,
		 ADC_CH0 		& 
		 ADC_INT_OFF,
		 ADC_VREFPLUS_VDD);

since i used ADC_VREFPLUS_VDD......according to the compiler library it means
VREF+ = AVDD
......meaning im using my VDD as my VREF+ (or so i tot) .....but when compiled it assumed i was providing VREF+ into the AN3 pin!

so added this ADCON1=0b00001101; and hola eth is working =.=.....

i wonder...is it damn thing a bug of the MC18 or is it dat i used it in a wrong way

and btw......appreciated ebody's help
 
Hi,
Hopefully it's not too late to reply
Acquisition time is the time taken for the sampling capacitor to be charged up (find "sample and hold" for more info). So the source impedance is to keep minimum to ensure minimum acquisition time.
As for A/D conversion clock, it's just another clock for ADC. This clock is derived from the microcontroller oscillator or internal RC. For some PIC, it is between 2 us to 6 us, so based on the oscillator frequency of the system, select the scale according to the table given in the datasheet.

*EDIT: Time taken for one cycle of ADC is acquisition time + conversion time. Conversion time is usually 11 AD clock cycles, to convert the analog value across the charged capacitor to digital format.
 
Last edited:
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…