Skip to content

Instantly share code, notes, and snippets.

@edy555
Last active December 11, 2015 18:09
Show Gist options
  • Select an option

  • Save edy555/4639967 to your computer and use it in GitHub Desktop.

Select an option

Save edy555/4639967 to your computer and use it in GitHub Desktop.
from pylibftdi import BitBangDevice
from dds import AD9859, BitBangInterface
crystal = 25e6
mul = 16
fclk = mul * crystal
pins = { "sdio":4, "sclk":0, "ioupdate":2, "iosync":6, "reset":7 }
conf = { "pins":pins, "fclk":400e6, "refclk_multiplier":16, "vco_range":1 }
freq = 10e6
with BitBangDevice(direction = 0xff) as dev:
dev.baudrate = 115200
bb = BitBangInterface(dev)
dds = AD9859(bb, conf)
dds.reset()
dds.setup()
dds.set_frequency(freq)
dds.ioupdate()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment