|
|
View previous topic :: View next topic |
Author |
Message |
ac34856
Joined: 14 Dec 2009 Posts: 33 Location: Wales
|
AD7705 (again) Max value reading 31806 (0x7c3f) |
Posted: Fri Feb 05, 2010 9:54 am |
|
|
I'm just wrapping up a job. The AD7705 Zeroes itself but the offset required for zero volts is 0.45V and after this the maximum output I can get in UNIPOLAR mode is 31807 (0x7c3f).
I'd like it to zero at 0V which I assume is the reason for 31807 being the
max value but it dont seem to work !? Its likely to do with the setup
code and I've stuck 0x04 for the input mode as this allows me to
get zero out of it although as things stand this will need trimming out
with an op-amp with offset trim.
Anyone know whats wrong ??
Code: |
void init_adc(void)
{
fprintf(USB, "\r\nInitialising ADC : (reset)\n\r");
output_low(ADC_RESET);
output_high(ADC_CLK);
output_high(AD7705_CS);
output_high(ADC_RESET);
delay_ms(1000); fprintf(USB, "\rReset ADC (3 Seconds)");
delay_ms(1000); fprintf(USB, "\rReset ADC (2 Seconds)");
delay_ms(1000); fprintf(USB, "\rReset ADC (1 Second)");
fprintf(USB, "\r\nInitialising Zero Scale : \r\n");
setup_adc_device(ADC_ZERO_SCALE, ADC_GAIN_1, 0x04, ADC_50); //
delay_ms(100);
//setup_adc_device(ADC_FULL_SCALE, ADC_GAIN_1, 0x04, ADC_50);
// delay_ms(100);
// setup_adc_device(ADC_SELF, ADC_GAIN_1, 0x04, ADC_50);
// delay_ms(100);
setup_adc_device(ADC_NORMAL, ADC_GAIN_1, 0x04, ADC_50); //
} |
|
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Fri Feb 05, 2010 1:29 pm |
|
|
Look at this thread. He says there are several things wrong with the
CCS ad7705.c driver.
http://www.ccsinfo.com/forum/viewtopic.php?t=25806
For example, he says the ADC_BIPOLAR and ADC_UNIPOLAR definitions
are wrong. If you look on page 17 of the ad7705 data sheet, it looks
like he is correct. Bipolar is selected by setting the B/U bit = 0.
But CCS has it set to a 1. That might explain some of the weird
effects that you're seeing.
http://www.analog.com/static/imported-files/data_sheets/AD7705_7706.pdf
I suggest that you try his driver. But also you need to edit his driver to
add his suggested fix for the Bipolar and Unipolar constants.
Also, not to beat a dead horse here, but it would have been better to
keep all your ad7705 posts in one long thread, instead of doing individual
threads. That way it would have been one coherent learning experience
for anyone looking at it in the archives in the future. |
|
|
|
|
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
|