|
|
View previous topic :: View next topic |
Author |
Message |
w2drz
Joined: 27 Dec 2006 Posts: 55 Location: Western New York - USA
|
|
Posted: Sun May 08, 2011 2:24 pm |
|
|
Hi,
Had read the errata prior and had seen the offset fix/needs,
Not a problem in my app. as the customer for AD use,
it will be normal to calibrate his setup usage to use a min set voltage for the AD input zero calibrate,
so the offset error is calibrated out and also does a max voltage calibrate for the range setting
between zero and max for AD use and read out in 16 bit range.
Just that high offset error is distracting when working with this chip.
You did not mention on the define used as being correct,
#define VSS 0xFF //Analog Negative Channel connected to Vss
That define works as I expect to connect the AD Vref- to VSS.
Thanks for your help on the FUSE setting I had missed,
now can finish the change over code to this chip as it looks.
Thank You,
TGM W2DRZ
SEE errata:
The 12-bit ADC issues will be fixed in a future
revision of this part.
ADC Offset
The ADC may have high offset error up to a
maximum of 25 LSB; it can be used if the ADC
is calibrated for the offset.
Work around
Calibrate for offset, in Single-Ended mode, by
connecting ADC +ve input to ground and taking
the ADC reading. This will be the offset of the
device and can be used to compensate for the
subsequent ADC readings on the actual inputs. |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Sun May 08, 2011 3:11 pm |
|
|
Quote: | You did not mention on the define used as being correct,
#define VSS 0xFF //Analog Negative Channel connected to Vss
That define works as I expect to connect the AD Vref- to VSS |
But you don't use the 'VSS' symbol any place in your program.
So what can it do ? Notice below that 'VSS' is not used:
Quote: |
setup_adc_ports (sAN0|sAN1|sAN3|VSS_VDD);
setup_adc(ADC_CLOCK_DIV_64|ADC_TAD_MUL_20);
|
I looked at the .LST file for the setup_adc_ports() function. I don't think
CCS allows you to set the CHS0 to CHSN2 bits with that function.
I think if you want to set those bits, then you need to write directly to
the ADCON1 register. Or, you can write directly to those bits.
You can use #bit statements to define the bit addresses.
Then write to them with code in main(). |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|