Interfacing a DDS chip

The official pyboard running MicroPython.
This is the reference design and main target board for MicroPython.
You can buy one at the store.
Target audience: Users with a pyboard.
JAE
Posts: 3
Joined: Tue Oct 18, 2016 4:18 am

Interfacing a DDS chip

Postby JAE » Mon Mar 06, 2017 5:39 am

I would like to post a topic of writing the interface code for several DDS chips (Analog Devices). At this point I am having problems using the AD9834 would appreciate any help on this.

Thanks

JAE

User avatar
deshipu
Posts: 931
Joined: Thu May 28, 2015 5:54 pm

Re: Interfacing a DDS chip

Postby deshipu » Mon Mar 06, 2017 11:00 am

How can we help? Do you have any specific problems or questions?

I think the best starting point is reading the datasheet for the chip in question -- have you already tried this?

JAE
Posts: 3
Joined: Tue Oct 18, 2016 4:18 am

Re: Interfacing a DDS chip

Postby JAE » Tue Mar 07, 2017 2:49 am

I have reviewed the specification. I am having a problem with shifting data into the control registrar. Any help would be appreciated..

User avatar
deshipu
Posts: 931
Joined: Thu May 28, 2015 5:54 pm

Re: Interfacing a DDS chip

Postby deshipu » Tue Mar 07, 2017 7:51 am

So what do you have so far, and how the problem manifests itself?

JAE
Posts: 3
Joined: Tue Oct 18, 2016 4:18 am

Re: Interfacing a DDS chip

Postby JAE » Wed Mar 08, 2017 5:48 am

Here is my initial code for the serial registrar.

def shift16():
for i in range(16) #loop for 16 data bits
value = data & 0x8000 #look at left-most bit
SetPin (SDAT, Value) #puts its value on data line
data <<=1 #shift data bit to left
data &=0xFFFF #limit data to 16 bits
toggle sclk() #clock in the data bit_length
FSYNC.high() #bring FSYNC high after word sent

I am particularly concerned about the syntax,

Thanks JAE

User avatar
deshipu
Posts: 931
Joined: Thu May 28, 2015 5:54 pm

Re: Interfacing a DDS chip

Postby deshipu » Wed Mar 08, 2017 3:56 pm

I guess to learn Python's syntax it's best to start with the official tutorial: https://docs.python.org/3/tutorial/

For sending data to that chip, you would probably be best off using the SPI peripheral: http://docs.micropython.org/en/latest/p ... e.SPI.html


Return to “The MicroPython pyboard”

Who is online

Users browsing this forum: No registered users and 1 guest