Just a precision thing. With more precision you can can expect more "bouncing" sometimes noise will cause this or the sensor it's self. A lot of sensors a pretty sensitiveSometimes a capacitor from the ADC pin to zero will help smooth thing out, This may even be needed with some 8 bit applications.
Yep there is always more than one way do do anything. I coding we call this a style.My other observation/question based on your statment about switching back and fourth between 10 bit and 8 bit. From my observations and looking at many examples of code there is always more then one way to accomplish something in the coding. I didn't miss anything here right I mean:
For your chipADCON1 = %10000000
'ADCON1.7 = 1 'I DID THAT ABOVE RIGHT?
Setting ADCON1.7 = 1 is essentially the same thing as my example correct? You're just setting the individual bit right?
ADCON1 = %10000000
makes all of th ADC pins analog, left justified, VREF+ at VDD and VREF- at VSS.
If you want some of the ADC pins digital or change the VREFs then you will run into a problem.
ADCON1.7 = 1 or 0 is just changing that particular bit.
Not quite... In the data sheet I have for this chip take a look at section 11.4.1.After this experience and reviewing what you taught me and looking at Bruce's example more closely that you could accomplish the 8 bit using the ADCIN by just setting ADC_BITS=8 in the beginning and the read on ADCIN basically puts both the ADRESH and ADRESL together for you in your variable. If you choose to use Bruce's method and wanted to do the 10 bit you've got to put those two result registers together right? Setting ADC_BITS is a one time thing at the beginning?
The register containing ADRESH and ADRESL is really 16 bits wide. ADRESH and ADRESL are 8 bits each.
This all can be quite confusing, if this forum was not here I would not have a clue either.It's tough even with the datasheet until someone get's you pointed in the right direction. I think I am intellegent and I should be able to figure this stuff out but thats not always so. Now that you've given me direction it's much clearer I appreciate the help I get from this forum.
Bookmarks