CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

AD7705 (again) Max value reading 31806 (0x7c3f)

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
ac34856



Joined: 14 Dec 2009
Posts: 33
Location: Wales

View user's profile Send private message

AD7705 (again) Max value reading 31806 (0x7c3f)
PostPosted: Fri Feb 05, 2010 9:54 am     Reply with quote

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

View user's profile Send private message

PostPosted: Fri Feb 05, 2010 1:29 pm     Reply with quote

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.
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
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