09-15-2023 08:54 AM
Hi,
I'm planing to control two SPI devices using a cRio with 9401 module. The examples shows only slave devices that runs with the same clock frequency. In my application I have two devices that are rated with 2 Mhz and 20 Mhz respectively, also the Cpol and Cpha differs as well as the bit numbers. So my question is if it possible to configure the 9401 to run at two different configurations in parallel (not simultaneous of course). Both devices share a common spi bus which means that I could use one 9401 to set two CS outputs, the other two output would be data out and clock.
Best regards
Ahmed
09-15-2023 12:16 PM
I don't see why you cannot do that. You are just using FPGA IP to drive individual DIO ports.
Which IP are you using? Is it NI SPI IP Toolkit for LabVIEW?
09-18-2023 01:54 AM
That is what I thought as well but it is not clear from the examples that come with the SPI and I2C Driver API how to do that (there is not much documentation on the VIs included in this package). No I'm not using the SPI IP Toolkit but the toolkit in the driver mentioned above.
Best regards
Ahmed
09-19-2023 10:10 AM
I did some time spending on the API but didn't really figure out how to do that. So I wrote my on "SPI bus". Haven't got the cRio and the 9401 modules yet so I'm not able to test the code. Anyhow I have included the FPGA VI just to illustrate what I wand to do. Note that the host will make sure that these two loops will not run at the same time. It is the first time I'm working with SPI interface so I would appreciate if I get any feed back on this VI.
Best regards
Ahmed
09-20-2023 09:46 AM
After carefully reading the data sheets of the DAC and ADC, I wrote another version of the code. Hopefully this one will work.