Sampling on RA0/AN0

Status
Not open for further replies.

sardineta

New Member
I have configured the ADC on the PIC16F870.
I am not sure what kind of signal or DC level should be in it without any connection at this pin.

I put the oscilloscope and I see this signal at RA0/AN0 pin

does it is correct?

even with a signal the same pulsed signal is mounted over the DC level

does I need a capacitor or what configuration is needed?

thanks
 

Attachments

  • ra0an0_196.jpg
    5.7 KB · Views: 525

I can't say I've ever tried connecting a scope to the input pin, with nothing connected?. Possibly you are seeing pulses as it samples to the sample and hold?, what do you have connected to the pin? - maximum source impedance should be 2.5K, try connecting a resistor to gnd from the pin.

If this in any way affecting your readings?.
 
not at all, this pulse affects the signal, however for me it is strange,
the figure shows what I have connected to the pin

The final resistor is 2.2K

Do I have to connect another resistor of 2.5K from RA0/AN0 to GND?

thank you
 

Attachments

  • analog_stage00.jpg
    11.2 KB · Views: 499
Perfect, Nigel.
thanks a lot
By the way, all unused pins should be connected to gnd without resistors

I am checking the circuit becasue I have noise when a device is connected to the outlet or a lamp is turned on/off.

this noise is presented in the gnd and in the voltage source.

I have reduced 50% of the spikes grounding PORTB to gnd from 1V at 500 or 600mV but I need more because some spikes reach more than 500mA the ADC reads this spikes but they are noise and not the DC level
my setpoint is fixed at 220mV, I do not know how to change it becasue other set point is fixed at 2V here is ok, but at 220mV as setpoint I have false readings.

Thanks
 
The PIC16F870 has two Vss pins one of the at the left and the other at the right.

The Vss pin near the OSC1 and OSC2 is wired with the Vss pin that is near the Vdd.

in other words all Vss pins from the uC are wired at GND
 
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…