{"action":"created","issue":{"url":"https://api.github.com/repos/m-labs/artiq/issues/364","repository_url":"https://api.github.com/repos/m-labs/artiq","labels_url":"https://api.github.com/repos/m-labs/artiq/issues/364/labels{/name}","comments_url":"https://api.github.com/repos/m-labs/artiq/issues/364/comments","events_url":"https://api.github.com/repos/m-labs/artiq/issues/364/events","html_url":"https://github.com/m-labs/artiq/issues/364","id":144728352,"number":364,"title":"synchronising multiple AD9914s","user":{"login":"r-srinivas","id":11219276,"avatar_url":"https://avatars.githubusercontent.com/u/11219276?v=3","gravatar_id":"","url":"https://api.github.com/users/r-srinivas","html_url":"https://github.com/r-srinivas","followers_url":"https://api.github.com/users/r-srinivas/followers","following_url":"https://api.github.com/users/r-srinivas/following{/other_user}","gists_url":"https://api.github.com/users/r-srinivas/gists{/gist_id}","starred_url":"https://api.github.com/users/r-srinivas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/r-srinivas/subscriptions","organizations_url":"https://api.github.com/users/r-srinivas/orgs","repos_url":"https://api.github.com/users/r-srinivas/repos","events_url":"https://api.github.com/users/r-srinivas/events{/privacy}","received_events_url":"https://api.github.com/users/r-srinivas/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/m-labs/artiq/labels/type:question","name":"type:question","color":"d4c5f9"},{"url":"https://api.github.com/repos/m-labs/artiq/labels/type:support","name":"type:support","color":"e99695"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":18,"created_at":"2016-03-30T21:46:13Z","updated_at":"2016-04-15T17:58:23Z","closed_at":null,"body":"We'd like to synchronise multiple AD9914s on our setup following the instructions on page 5 of [http://www.analog.com/media/en/technical-documentation/application-notes/AN-1254.pdf].\r\n\r\nIt can be done by setting the sync_out bit on all the DDS, not just the master. This basically involves writing to multiple DDS' and then providing an io_update that need not be synchronous. Would the best way of going about this be in modifying the runtime, or would it be better if there were some sort of dds_write and io_update function in dds.py that let the user do it separately? \r\n\r\nThis seems to work on two dds' that I've programmed through SPI. The code is,\r\n\r\n```python\r\ndds.reset()\r\n\r\n# step 3, dac calibration\r\n\r\ndds.write(1, np.array([0x03, 0x01, 0x05, 0x21, 0x20]))\r\ndds.io_update()\r\ndds.write(2, np.array([0x03, 0x01, 0x05, 0x21, 0x20]))\r\ndds.io_update()\r\n\r\n# step 4, set sync_out on dds'\r\n\r\ndds.write(1, np.array([0x01, 0x00, 0x89, 0x0B, 0x00]))\r\ndds.write(2, np.array([0x01, 0x00, 0x89, 0x0B, 0x00]))\r\ndds.io_update()\r\n\r\n# step 5, set cal with sync_bit\r\n\r\ndds.write(1, np.array([0x1B, 0x00, 0x00, 0x08, 0x40]))\r\ndds.write(2, np.array([0x1B, 0x00, 0x00, 0x08, 0x40]))\r\n\r\n# step 7, dac calibration\r\n\r\ndds.write(1, np.array([0x03, 0x01, 0x05, 0x21, 0x20]))\r\ndds.io_update()\r\ndds.write(2, np.array([0x03, 0x01, 0x05, 0x21, 0x20]))\r\ndds.io_update()\r\n```\r\n\r\n`dds.write(slave_select, array)`\r\n"},"comment":{"url":"https://api.github.com/repos/m-labs/artiq/issues/comments/210565551","html_url":"https://github.com/m-labs/artiq/issues/364#issuecomment-210565551","issue_url":"https://api.github.com/repos/m-labs/artiq/issues/364","id":210565551,"user":{"login":"sbourdeauducq","id":720864,"avatar_url":"https://avatars.githubusercontent.com/u/720864?v=3","gravatar_id":"","url":"https://api.github.com/users/sbourdeauducq","html_url":"https://github.com/sbourdeauducq","followers_url":"https://api.github.com/users/sbourdeauducq/followers","following_url":"https://api.github.com/users/sbourdeauducq/following{/other_user}","gists_url":"https://api.github.com/users/sbourdeauducq/gists{/gist_id}","starred_url":"https://api.github.com/users/sbourdeauducq/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sbourdeauducq/subscriptions","organizations_url":"https://api.github.com/users/sbourdeauducq/orgs","repos_url":"https://api.github.com/users/sbourdeauducq/repos","events_url":"https://api.github.com/users/sbourdeauducq/events{/privacy}","received_events_url":"https://api.github.com/users/sbourdeauducq/received_events","type":"User","site_admin":false},"created_at":"2016-04-15T17:58:23Z","updated_at":"2016-04-15T17:58:23Z","body":"Yes. Looks good. I would make the sync optional (via a function argument, this also needs updating the driver). And keep ``DDS_USR0`` sorted."}}