AD9833 and SPI ->> not woeking

For Flowcode users to discuss projects, flowcharts, and any other issues related to Flowcode 6.

Moderator: Benj

Post Reply
rradojko
Posts: 40
Joined: Thu Jun 21, 2012 8:53 am
Has thanked: 10 times
Been thanked: 2 times
Contact:

AD9833 and SPI ->> not woeking

Post by rradojko »

Hello.

I wrote a program Flowcode 6 for the AD9833 DDS generator. I use Arduino Nano.
I helped you with this topic. AD9833 is controlled via the SPI bus.

But I have a problem with the SPI bus. SPI is not working.

I enclose a program Flowcode 6. The values of the bits for example 400Hz. Here is an example
Here is datasheet AD9833

Im asking for help. What am I doing wrong? How to properly configure the SPI?
Attachments
AD9833 and Arduino Nano.jpg
AD9833 and Arduino Nano.jpg (139.61 KiB) Viewed 6297 times
AD9833_test_.fcfx
(8.3 KiB) Downloaded 346 times
Last edited by rradojko on Sat Jun 03, 2017 9:30 pm, edited 1 time in total.

rradojko
Posts: 40
Joined: Thu Jun 21, 2012 8:53 am
Has thanked: 10 times
Been thanked: 2 times
Contact:

Re: AD9833 and SPI ->> not woeking

Post by rradojko »

Here I checked SPI with "Seale logic" analyzer. SPI is not working.
Attachments
AD9833_spi_Seale_logic.JPG
AD9833_spi_Seale_logic.JPG (195.69 KiB) Viewed 6296 times

User avatar
LeighM
Matrix Staff
Posts: 2178
Joined: Tue Jan 17, 2012 10:07 am
Has thanked: 481 times
Been thanked: 699 times
Contact:

Re: AD9833 and SPI ->> not woeking

Post by LeighM »

Hi,
I've just tested this on a Uno (I don't currently have a Nano) and the SPI works fine.
Perhaps there is an issue with your Seale logic analyzer setup?
Based on a quick look at the AD9833 datasheet I would suggest you try changing the Clock Polarity to "Idle HIgh" and Clock Phase to "Trailing Edge"
Hope that helps
Leigh

rradojko
Posts: 40
Joined: Thu Jun 21, 2012 8:53 am
Has thanked: 10 times
Been thanked: 2 times
Contact:

Re: AD9833 and SPI ->> not woeking

Post by rradojko »

LeighM thanks for the reply.
I will try to set up and your proposal (Clock Polarity to "Idle HIgh" and Clock Phase to "Trailing Edge").

I have another question.

How do you test SPI bus?

You can paste the PrintScreen logic analyzer.?
That to me would be helpful.

And one more question.
The figure below.
What is set in the SPI bus (Sample Point )?
Attachments
spi_settings_flowcode.jpg
spi_settings_flowcode.jpg (89.94 KiB) Viewed 6253 times

User avatar
LeighM
Matrix Staff
Posts: 2178
Joined: Tue Jan 17, 2012 10:07 am
Has thanked: 481 times
Been thanked: 699 times
Contact:

Re: AD9833 and SPI ->> not woeking

Post by LeighM »

How do you test SPI bus?
I used your program, but put the send bytes in a loop with a delay, so that I could see a repetitive output on an oscilloscope.
I could see the clock and (MOSI) data pulses without any problem.
You can paste the PrintScreen logic analyzer.?
Sorry, I've now given the hardware back to a colleague I borrowed it from :roll:
What is set in the SPI bus (Sample Point )?
That determines at what point a sample is taken in the (MISO) data pulse to determine if it is high or low.

Post Reply