There is someone to help me with the commands SPI of AD9833.
I can pay. thanks
AD9833
-
- Valued Contributor
- Posts: 998
- Joined: Wed Dec 09, 2020 9:37 pm
- Has thanked: 106 times
- Been thanked: 517 times
Re: AD9833
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
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
-
- Valued Contributor
- Posts: 1188
- Joined: Thu Dec 03, 2020 10:57 am
- Has thanked: 289 times
- Been thanked: 418 times
Re: AD9833
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
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
-
- Valued Contributor
- Posts: 998
- Joined: Wed Dec 09, 2020 9:37 pm
- Has thanked: 106 times
- Been thanked: 517 times
Re: AD9833
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
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
-
- Valued Contributor
- Posts: 998
- Joined: Wed Dec 09, 2020 9:37 pm
- Has thanked: 106 times
- Been thanked: 517 times
Re: AD9833
I've nothing to test with - but try something like:
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
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
-
- Valued Contributor
- Posts: 1188
- Joined: Thu Dec 03, 2020 10:57 am
- Has thanked: 289 times
- Been thanked: 418 times
Re: AD9833
Hi
I think the code is from the Application Note document
I wasn't aware of the Arduino "quirk" re pin 10. Good to know
Regards
I think the code is from the Application Note document
I wasn't aware of the Arduino "quirk" re pin 10. Good to know
Regards