From 0076fc42163a4837badefe28fc48e56e206c0275 Mon Sep 17 00:00:00 2001 From: Sebastien Bourdeauducq Date: Tue, 15 Mar 2016 22:02:29 +0800 Subject: [PATCH] analyzer: fix AD9914 FTW decoding --- artiq/coredevice/analyzer.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/artiq/coredevice/analyzer.py b/artiq/coredevice/analyzer.py index e58eacfd4..a32334f7f 100644 --- a/artiq/coredevice/analyzer.py +++ b/artiq/coredevice/analyzer.py @@ -230,13 +230,15 @@ class DDSHandler: self.selected_dds_channels = self._gpio_to_channels(message.data) for dds_channel_nr in self.selected_dds_channels: dds_channel = self.dds_channels[dds_channel_nr] - if message.address in range(0x2d, 0x2f): - dds_channel["ftw"][message.address - 0x2d] = message.data + if message.address == 0x2d: + dds_channel["ftw"][0] = message.data + elif message.address == 0x2f: + dds_channel["ftw"][1] = message.data elif message.address == 0x31: dds_channel["pow"] = message.data elif message.address == 0x80: # FUD if None not in dds_channel["ftw"]: - ftw = sum(x << i*8 + ftw = sum(x << i*16 for i, x in enumerate(dds_channel["ftw"])) frequency = ftw*self.sysclk/2**32 dds_channel["vcd_frequency"].set_value_double(frequency)