Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Help using AD7715(ADC)

Status
Not open for further replies.

leojose

New Member
Hi,

I am develping a project where i've to interface an AD7715 (16-bit serial adc of analog devices) with my PIC18f452. I have gone through the datasheets and application notes of both of them, but unfortunately haven't been able to start communication b/w them. If u could help me with codes for interfacing the AD7715, i would be grateful.
Other issues regarding the ADC in question are:
1) can it be used for frequencies other than 1Mhz and 2.476Mhz?
if yes, then what should its CLK bit setting be?
2)Will it accept -ve voltages as references or inputs?

Regards
 
AD7715 is a single supply device.

Analog inputs can be Vdd + 30mv and AGND - 30mV, with BUF==0. It can effectively capture voltages in this range. So, it can handle only very slightly negative inputs.

I assume the inputs have protection diodes that will begin to conduct if the voltage on the pin exceeds these margins too far.

That part uses a common SPI interface. There are lots of examples of code, but it would have to be tweaked to follow the format listed in the AD7715 spec.

First make sure the part's clock is oscillating. Then look to see that DREADY toggles and you have SOMETHING come out of the DOUT.
 
Hi Oznog,

Thanks for the reply

I have noticed a funny thing happening with my circuit. My controller does generate a CLK pulse and its visible on the C.R.O. but when i connect it to the ADC, it goes to a logic high state. Without a clock there is no way i can receive or send data.Does the ADC have capacity to control the CLK signal in any way? or could it be some error in my hardware...in short what are the possible errors that could give rise to this?
Secondly, if the data output rate of the adc is say 150ms and my reading of the data takes longer, would it cause a loss/corruption of data.
Thirdly, how can i verify that my ADC is working or not?

Regards,
Leo
 
As per datasheet, the AD7715 has no ability to generate a SCLK, it is exclusively and input you must provide with your controller. This isn't a bad thing, generating SCLK internally can be worlds of hurt to follow on your microcontroller without losing clock cycles.

What PIC pin are you using for SCLK? Verify that you have defined it as an output in the TRIS reg, and that no other PIC module may be controlling it (such as, if it's a pin that can be used for PWM, that the PWM reg hasn't enabled the module).

If the AD7715 is wired incorrectly with VDD==GND==5V, protection diodes will try to prevent the input from being pulled lower than GND, but you would still expect to see to drop to 4.7V.

Verify your PIC is otherwise operational. Make it invert some unused pin over and over and see that it's inverting on your scope.

I do not know what C.R.O. is, clarify if it's relevant.
 
Thanks for your replies,

I verified my hardware and to my horror found that the probe of my C.R.O. (scope) was faulty! A loose connection caused it to work sometimes and sometimes not.
Now I can see clock signals on the CLK pin and pulses on the DIN (input pin of the ADC).
But the other problem I face now is ... no pulses on the DOUT pin.
The data format going into the ADC has been verified and I expect the AD
C to respond. But I somehow feel that the chip is faulty.
Could you suggest me a way to find out if its in working condition or not?
By the way I'm using PIC18f452.

Kind Regards
 
Verify MCLK_IN is being provided.
Do you have CS_n low?
Do you have RESET_n high?
Does DREADY_n go low to indicate the data is ready?

Are you totally sure you followed the protocol on DIN? Did you follow all the init procedures in the spec sheet and wait an appropriate time after reset deassert before beginning the DIN transaction?

You've probably a long way from the logical conclusion that the chip is dead.
 
Verify MCLK_IN is being provided.
Yes, I checked the clock pulses at MCLK_OUT (1.8MHz) on the scope.

Do you have CS_n low?
Yes, I have grounded this pin

Do you have RESET_n high?
Yes, this pin has been connected to supply.

Does DREADY_n go low to indicate the data is ready?
I can see continuous spikes on this pin. They are positive spikes though.

Are you totally sure you followed the protocol on DIN? Did you follow all the init procedures in the spec sheet and wait an appropriate time after reset deassert before beginning the DIN transaction?
To my best of knowledge, I think I did follow everything. But i can verify that if I could get some working code.

Kind regards
 
Do you have DOUT connected to a PIC pin mistakenly defined as an output, or accidentally grounded?
 
I checked that also, the DOUT of the USB chip is connected to the 'DIN' of the PIC which is an input.And it is not grounded.
 
USB chip?? Do you mean the ADC chip? How does USB get into this?

I think I'm out of ideas unless you've got something wrong in the protocol. Now DREADY should indicate that an input was received successfully, I wonder if there's anything you can do wrong with clocking in something extra on DIN that could muck with the transaction? I don't know.

I'd still bet that something we talked about has been overlooked. Usually happens that way with me.
 
I'm sorry about the USB chip...I actually meant the ADC chip.(In fact, i'm working on these two chips at the same time and so the confusion)...sorry.

Well even I have ran out of ideas and that is why I would like to verify somehow that my chip is dead!

Thanks for your time and effort though.
 
Status
Not open for further replies.

New Articles From Microcontroller Tips

Back
Top