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

using file.c

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



Joined: 20 Apr 2007
Posts: 111

View user's profile Send private message Send e-mail

using file.c
PostPosted: Thu Jun 28, 2007 1:59 pm     Reply with quote

hi everybody...

I have ADC7715 drive and I want use in my main code.
how is the procedure to read values from ADC7715?
if i had using ADC from PIC I would use
test=read_adc();

tks

nina
Humberto



Joined: 08 Sep 2003
Posts: 1215
Location: Buenos Aires, La Reina del Plata

View user's profile Send private message

PostPosted: Thu Jun 28, 2007 2:53 pm     Reply with quote

Really the device is an ADC but the code is AD7715.

test=read_adc(); // is used ONLY when the ADC is built in a microcontroller.

The get out a serial digital word with an AD value from a device like the AD7715 and
others, is used a predefined procedure according to know standars.
This procedure is used to configure the internal registers to customize its behaviour
to the required application.
Every device has its own characteristics and functionalities, which are described
in datasheets in terms of commands and waveforms by the AD manufacturer.
SPI is a industry-standard serial interface used widely in modern devices to communicate
with microcontrollers.

Is it not as easy to handle this device for a beginner, anyway following you will
find an Application Note describing how to use an SPI controller.

http://www.analog.com/UploadedFiles/Application_Notes/538964965031881813AN_877.pdf


Humberto
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Thu Jun 28, 2007 3:22 pm     Reply with quote

CCS has a driver for it:
Quote:
c:\program files\picc\drivers\ad7715.c


It has these functions:
Code:
void adc_init();
long int read_adc_word();
long int read_adc_value();
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