I’m currently working with QSPICE and using a DLL block for custom modeling. I noticed that the DLL symbol only allows input and output ports, but there doesn’t seem to be any option for a true bidirectional (inout) port.
In my application, I need a node that:
Can be driven by the DLL under certain conditions
Can be released (high-impedance) at other times
Can always be sensed/read by the DLL
Essentially, I’m trying to emulate something similar to a tri-state or open-drain bidirectional signal.
How about using 1 in and 1 out (then connect this pin to an NMOS) to emulate such open drain pin. Then somehow write a driver in C to perform such function.
Anyway, there is a complication to make it natively. Basically because Qspice Cblock has 1 timestep delay between the input and output and also with how Qspice integrate Cblock with the rest of the analog solver
check the I2S example SDA should be bidirectional.
Also like @physicboy said you can have a low impedance output and a high impedance input wired together.
As for the time step delay: just use a smaller step and add some more margin like real systems.
IRL nothing is exact so try triggering on signal edges.