- Edited
I'd like to communicate using the DIO-RJ45 card with a different device in a SPI-like protocol. For that, I need to generate a clock and change the signal line at the rising edge. I'd like to achieve clock rates of 50MHz, but even 20MHz would be significant progress.
Currently, I am using bit-banging. For example, this is how I currently generate the clock (self.clk is a TTL of DIO-RJ45):
def clock(self, cycles: TInt32) -> None:
"""Output cycles of clocks."""
"""
for _ in range(cycles):
delay(self.step_s)
self.clk.on()
delay(self.step_s)
self.clk.off()
The down-side of this approach is that I run in RTIO Underflow Errors at higher clock rates. Even pre-recording the sequences using DMA only helps so much as the bandwidth of the DMA is not sufficiently high for clock rates of 20MHz.
Is there a more efficient way to generate SPI-like signals (clock + data line)? The DIO-RJ45 wiki mentions that LDVS_1 is clock-capable. Is SPI natively supported by DIO-RJ45? If not, what would need to be changed to add such support?