I had the same issue with our newly bought crate - you might need to flip the direction switch.
For us, this could be done via I2C with the following code (from technosystem):
from artiq.experiment import *
from artiq.coredevice.i2c import *
from artiq.coredevice.kasli_i2c import port_mapping
class SinaraTester(EnvExperiment):
kernel_invariants = {"port_mapping", "bank_val"}
def build(self):
self.setattr_device("core")
self.setattr_device("i2c_switch0")
self.setattr_device("i2c_switch1")
self.setattr_device("dio0_expander")
self.setattr_device("ttl5")
self.port_mapping = [
7, # EEM0
5, # EEM1
4, # EEM2
3, # EEM3
2, # EEM4
1, # EEM5
0, # EEM6
6, # EEM7
12, # EEM8
13, # EEM9
15, # EEM10
14, # EEM11
]
self.bank_val = [
[ # SMA
0b11110000, # Bank 0
0b00001111 # Bank 1
],
[ # MCX
0b11111110, # Bank 0
0b11111101, # Bank 1
0b11111011, # Bank 2
0b11110111 # Bank 3
]
]
@kernel
def set_dio_output(self, dio_type, eem, bank):
# Enable I2C bus to EEM
i2c_sw_ch = self.port_mapping[eem]
if i2c_sw_ch < 8:
i2c_sw = self.i2c_switch0
else:
i2c_sw = self.i2c_switch1
i2c_sw_ch -= 8
i2c_sw.set(i2c_sw_ch)
# Set direction to output
self.dio0_expander.set(self.bank_val[dio_type][bank])
@kernel
def run(self):
self.core.reset()
# First set the direction of the DIO hardware buffers
self.set_dio_output(dio_type=0, eem=2, bank=1)
# I2C operations are not real-time and slow, need break realtime
self.core.break_realtime()
# Then set the gateware channel to output
self.ttl5.output()
You have to add dio0_expander
to tour device_db.py file
device_db["dio0_expander"] = {
"type": "local",
"module": "artiq.coredevice.i2c",
"class": "PCF8574A",
"arguments": {
"busno": 0,
"address": 0x7c
}
}