AD9833

Post and discuss new components that you have created.
Vatel20
Posts: 19
http://meble-kuchenne.info.pl
Joined: Wed Dec 16, 2020 10:07 am

Flowcode v9 AD9833

Post by Vatel20 »

There is someone to help me with the commands SPI of AD9833.
I can pay. thanks

mnfisher
Valued Contributor
Posts: 953
Joined: Wed Dec 09, 2020 9:37 pm
Has thanked: 104 times
Been thanked: 507 times

Re: AD9833

Post by mnfisher »

It looks easy to use - see https://gist.github.com/m5mat/d102c36f2 ... 5dbc4c2372 for some C code.

The datasheet I found doesn't seem to contain a detailed description of the control register however - more googling needed.

If you'd like to send me a couple of the chips I'll do it.

Martin

mnfisher
Valued Contributor
Posts: 953
Joined: Wed Dec 09, 2020 9:37 pm
Has thanked: 104 times
Been thanked: 507 times

Re: AD9833

Post by mnfisher »


chipfryer27
Valued Contributor
Posts: 1146
Joined: Thu Dec 03, 2020 10:57 am
Has thanked: 284 times
Been thanked: 412 times

Re: AD9833

Post by chipfryer27 »

Hi

Following on from Martin, this link is to Analogue Devices

https://www.analog.com/en/products/ad98 ... t-overview

If you scroll down you will see many documents relating to the device including SPI and Programming.

Regards

Vatel20
Posts: 19
Joined: Wed Dec 16, 2020 10:07 am

Re: AD9833

Post by Vatel20 »

What am I doing wrong ?
Attachments
AD9833.fcfx
(13.81 KiB) Downloaded 128 times

mnfisher
Valued Contributor
Posts: 953
Joined: Wed Dec 09, 2020 9:37 pm
Has thanked: 104 times
Been thanked: 507 times

Re: AD9833

Post by mnfisher »

One issue - in SPISendData - you create a block of 10 bytes, but only send 4.
SendByteArray(4, data) - should this be SendByteArray(10, data)

Martin

Vatel20
Posts: 19
Joined: Wed Dec 16, 2020 10:07 am

Re: AD9833

Post by Vatel20 »

I fixed it but it still doesn't output.
thank you

mnfisher
Valued Contributor
Posts: 953
Joined: Wed Dec 09, 2020 9:37 pm
Has thanked: 104 times
Been thanked: 507 times

Re: AD9833

Post by mnfisher »

The device needs a brief delay after pulling fsync low - about 10microsecs

Looking at the sample code (link above) - it looks as though 32 bit data must be sent 16bits at a time (with fsync toggled between words)

Martin

mnfisher
Valued Contributor
Posts: 953
Joined: Wed Dec 09, 2020 9:37 pm
Has thanked: 104 times
Been thanked: 507 times

Re: AD9833

Post by mnfisher »

I've nothing to test with - but try something like:
AD833Test.fcfx
(18.47 KiB) Downloaded 129 times
Note that I've used pin 10 as FSYNC (also known as CS or ChipSelect) - on the Arduino this must be set as an output for SPI to work correctly. I've set the pin high at the start of the chart - so if you used a different pin as CS - it should still work. If you use something other than Arduino though - remove this line.

Note this is a quick conversion of the code on github - I feel the frequency calculation could be tidied up (and may overflow as is) - possibly multiply by a smaller number and reduce ref by a suitable factor.


Martin

chipfryer27
Valued Contributor
Posts: 1146
Joined: Thu Dec 03, 2020 10:57 am
Has thanked: 284 times
Been thanked: 412 times

Re: AD9833

Post by chipfryer27 »

Hi

I think the code is from the Application Note document

AN-1070.pdf
(127.02 KiB) Downloaded 141 times

I wasn't aware of the Arduino "quirk" re pin 10. Good to know :)

Regards

Post Reply