Some problems with AD5932 - Page 1
Forum section: electronics / projects

author: Jacky_88
author_rank: Contributor
timestamp: December 03, 2016, 05:53:59 pm
content: Hello,at the moment I'm trying to get an AD5932 running. It's soldered onto an adapter-PCB for my breadboard. The clock signal (MLCK) comes from an oscillator with TTL output. I'm using 50Mhz and 25Mhz oscillators. I've read themanualand theapplication note. The AD5932 is controlled with a Atmega 1284p and SPI. This is the code which is send at startup:Code:CTRL_HIGH;SS_LOW;_delay_us(10);SPI::Transmit(0b00001101);//CREGSPI::Transmit(0b11111111);SS_HIGH;_delay_us(10);SS_LOW;SPI::Transmit(0b11001110);//FSTART LSBSPI::Transmit(0b10111000);SS_HIGH;_delay_us(10);SS_LOW;SPI::Transmit(0b11010000);//FSTART MSBSPI::Transmit(0b01010001);SS_HIGH;_delay_us(10);SS_LOW;SPI::Transmit(0b00100011);//DELTAF LSBSPI::Transmit(0b00010010);SS_HIGH;_delay_us(10);SS_LOW;SPI::Transmit(0b00111000);//DELTAF MSBSPI::Transmit(0b00001000);SS_HIGH;_delay_us(10);SS_LOW;SPI::Transmit(0b00010000);//NINCRSPI::Transmit(0b01011010);SS_HIGH;At the moment I'm not able to control the chip. Can someone help me?

author: Jacky_88
author_rank: Contributor
timestamp: December 05, 2016, 08:57:29 am
content: A "screenshot" of th SPI communication. It shows the writing of the first 16 bits to the CREG-Register.

author: ace1903
author_rank: Regular Contributor
timestamp: December 05, 2016, 09:12:36 am
content: It is difficult to see from the picture but I would guess that problem is in SPI mode that is set.In datasheet says that data is clocked into the AD5932 on each falling SCLK edge.On scope screen looks like that data is clocked in on rising edge.Zoomed part with data to clock edge transition would help.

author: Jacky_88
author_rank: Contributor
timestamp: December 05, 2016, 09:41:14 am
content: Okay, I've changed it:(BTW: channel 4 (blue) shows the CTRL-Pin level. It's held low while writing and taken high after the las transmission)

author: ace1903
author_rank: Regular Contributor
timestamp: December 05, 2016, 10:05:39 am
content: Make test with corrected SPI mode.Use metod setDataMode() to change default mode.https://www.arduino.cc/en/Reference/SPISetDataMode

author: Jacky_88
author_rank: Contributor
timestamp: December 05, 2016, 01:38:09 pm
content: I think I have found the problem. The chip is made by Analog Devices. So the chip isn't capable of any digtal function.I've been trying to get this IC working for at least 4 weeks now and I haven't got any results yet. Today the second AD5932 I odered showed the same behaviour. I tryed to build everything according to the shematics of the evaluationboard given in the datasheed and nothing changed. I give up on this one - maybe TI, LT or Maxim offer a more robust solution.But I want to thank you for your help

author: ace1903
author_rank: Regular Contributor
timestamp: December 05, 2016, 02:55:36 pm
content: Think that you are very close to the solution(maybe 1h).Did you try to change SPI mode in software? Is it now clock edge corectly positioned?Post pictures of your setup.It is good that you have needed equippment but you need a bit experience in SW development.It will be dificult to find simpler device than AD5932.

author: Jacky_88
author_rank: Contributor
timestamp: December 05, 2016, 05:12:28 pm
content: believe me, I switched SPI-modes many times. I think, that the use of the 50 Mhz oszillator on a breadboard is a major problem. On the evaluation board the same device is used (big metal box), but of course the routing is more appropriate.On an other breadboard I'm using the ADS1248 (24 bit ADC) with no problems at all. At the beginnig it was difficult, but now it works very well and I wouldn't consider this IC as easy to use. The difference is, that the ADS1248'S manual is more detailed.

author: Jacky_88
author_rank: Contributor
timestamp: December 05, 2016, 05:19:27 pm
content: Okay, after 10 times switching power on and off it shows something like this. It seems to be in sweep mode and stops at a frequency of 6.25 Mhz. With my understanding of the data registers it shouldnt do that, because D5 in CREG is set to 1. Channel 1 shows VOUT and channel two MSBOUT.

author: IanJ
author_rank: Unknown
timestamp: December 05, 2016, 06:12:14 pm
content: Hi,As a test, connect a 33pF cap to the 1284 SPI SCK to gnd.I've had issues with 328P & 1284 SPI timing on some devices that the cap fixes.Ian.

author: ace1903
author_rank: Regular Contributor
timestamp: December 05, 2016, 06:23:27 pm
content: OK, main problem is breadboard. Last picture shows that chip responds to SW commands.Scope ground probe probably is connected in improper place and that is why you are seeing too much noise.I would guess that output filter is also missing. Maybe power decoupling with capacitors is also poor.DDS high frequency generator shouldn't be on breadboard!Any device (be it Maxim or anything else) will perform similar if put under similar conditions. It is better to spend some time to make PCB using toner transfer method with correct grounding and power decoupling. Use lower frequency if 50MHz is not a must.You have similar problems with ADS1248 but you are not aware of them. If you have made that with same approach as in DDS case you are getting probably no more than 10bit usable. Slow speed ADC averages noise and masks real problem. Use that board to measure small signal from thermocoulple and you will see that you will get random temperature readings.No one found magic workaround for good layout and proper power noise decoupling.Share pictures of the setup and forum members will help you to improve design. But from breadboard it is difficult to get something usable.

author: Jacky_88
author_rank: Contributor
timestamp: December 05, 2016, 07:57:50 pm
content: Okay. I just mentioned the ADC as an example for a more comple IC. I know that I will never see 24 bit on breadboard.The output shown is a random result, I just know, that it works. So I will make my own PCB

author: branadic
author_rank: Super Contributor
timestamp: December 05, 2016, 08:58:52 pm
content: Please check out the code written by my colleague Klaus Skibowski:www.mikrocontroller.net/attachment/71731/ad5932.h

author: Jacky_88
author_rank: Contributor
timestamp: December 06, 2016, 09:00:23 pm
content: @branadicThanks, I will see what I can do.I hope my designed PCB works(not finished yet)

author: Jacky_88
author_rank: Contributor
timestamp: January 13, 2017, 06:01:10 pm
content: Hello,the DDS-IC worksI got the previously shown pcb manufactuered and placed the remaining parts (capacitors) on it. The PCB is designed to be used with a breadboard. The AD5932 finally works and the signal shows much less interference, but I won't go higher than 1MHz. I have to say, that the AD5932's datasheet lacks some important information about the SPI communicatian sequence and the use of its additional inputs.