Disconnecting R1 is enough on the channel you want to connect it to the ground.
On Thu, Apr 8, 2010 at 8:59 AM, vasile surducan <[email protected]> wrote: > Seb, try to connect to the ground the floating input. If you still have the > same readout, then is a problem with the aquisition time (is too short and > on channel is "bitting" the other). > Still trying to say (again) that computing the aquisition time in library > based on mathemathical relations from datasheet is a waste of computing time > (even is at done at the compile time), because the aquisition time is > variable with some partially known parameters (and the worst is the package > temperature, the other is the input impedance) > > > On Wed, Apr 7, 2010 at 9:37 PM, Joep Suijs <[email protected]> wrote: > >> Hi Seb, >> >> This is to be expected. The adc has an internal capacitor. At >> converion, it is connected to a pin for some time to 'copy' the >> voltage level. The higher the input resistance, the longer this takes. >> Next, the capacitor is disconnected from the pin and the actual >> conversion is executed. >> So if you read a pin with very high input resistance (one that is not >> connected), the capacitors voltage will not (hardly) change and the >> conversion result is highly influenced by the previous measurement. >> >> No magic ;) >> Joep >> >> 2010/4/7 Sebastien Lelong <[email protected]>: >> > Hi guys, >> > I've setup a sample with 2 ADC channels, for 18f4550. Both are read >> > regularly, results are sent through serial. ADC channel #0 is connected >> to a >> > voltage divider (1K/1K). The other ADC channel #1 is connected to >> another >> > voltage divider (22K/1K). In this configuration, I got the following >> > results: >> > Result #0: 508 >> > Result #1: 1020 >> > Result #0: 508 >> > Result #1: 1020 >> > ... >> > So far so good... >> > Now I disconnect channel #1. Pin is floating in the air, not connected >> > anymore to voltage divider... I would expect some kind of random data on >> > this channel, but I got exactly the same result as the one from channel >> #0: >> > Result #0: 508 >> > Result #1: 508 >> > Result #0: 508 >> > Result #1: 508 >> > Result #0: 508 >> > ... >> > Doing the opposite give the same result from channel #1 (most of the >> time, I >> > admit): >> > Result #0: 1020 >> > Result #1: 1020 >> > Result #0: 1012 <-- this one is exceptional >> > Result #1: 1020 >> > Result #0: 1020 >> > Result #1: 1020 >> > Result #0: 1020 >> > Result #1: 1020 >> > Attached is the running sample. I really don't know what's going on. Is >> my >> > assertion about expected random values wrong ? Is there something with >> PIC's >> > internal ? >> > >> > Cheers, >> > Seb >> > >> > -- >> > You received this message because you are subscribed to the Google >> Groups >> > "jallib" group. >> > To post to this group, send email to [email protected]. >> > To unsubscribe from this group, send email to >> > [email protected]<jallib%[email protected]> >> . >> > For more options, visit this group at >> > http://groups.google.com/group/jallib?hl=en. >> > >> >> -- >> You received this message because you are subscribed to the Google Groups >> "jallib" group. >> To post to this group, send email to [email protected]. >> To unsubscribe from this group, send email to >> [email protected]<jallib%[email protected]> >> . >> For more options, visit this group at >> http://groups.google.com/group/jallib?hl=en. >> >> > -- You received this message because you are subscribed to the Google Groups "jallib" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/jallib?hl=en.
