05-03-2018 10:51 AM - edited 05-03-2018 10:53 AM
Hello Members,
I have an SPI master device which sends data to slave device. In response to Master data , slave device sends 6 byte of data and this process go repeatedly. I was trying to use NI 8452 but this can only be used as SPI master. Therefore i am trying to use NI 9401 and cDAQ chassis NI 9178.
My connection are as follows;
1. Master Clock into PF0 (in cDAQ NI 9178 Chassis)
2. Master; MOSI into NI 9401 Input Number 0.
3. Master MISO into NI 9401 Input Number 7 .
The read data from Master SPI device is working fine but writing data from SPI Slave to Master is not working.
Thanks
Regards
Muhammad
05-04-2018 05:43 PM
Hi MuhammadShazor,
Are you receiving an error when you run your code, or is it not behaving as expected? What is the behavior you are observing? In addition, could you attach your code?
05-07-2018 07:02 AM
Hello Brain,
Thanks for your response. As per now, I am not getting any error and I can visualize my data is being sent to the device but I am not getting any digital pulses at master device .
Regards
Muhammad Shazor
05-07-2018 06:53 PM
It looks like you may have already created a service request with us at NI for this issue, and it will probably be easier to troubleshoot through that process. A couple of thoughts:
05-08-2018 07:11 AM
Thanks for your reply . I have checked the DIO module using as Digital Outputs. It is working fine . I have also checked the MISO line using probe but i did not get any data.
Do you have any idea or thoughts on this issue.
05-08-2018 06:13 PM
What data have you tried writing in your array out?
05-09-2018 07:09 AM
Hello Brain,
The issue related to data writing is accomplished . Now I successfully write data from SPI slave device to my SPI Master device. The problem I am getting now is losing some data.
My logic is implemented as:
I am receiving data from SPI master using MOSI . On this line as soon as I received “E8” , my slave device should send data consist of 6 bytes. The master device only receive data when clock is present.
But I will lose some data which is transferred when clock is high as shown in attachment. In this way I will get wrong data on MISO line.
may you please let me know how to overcome this issue.
Thanks
Best Regards
Muhammad Shazor
Tenneco
05-10-2018 12:29 PM
I believe that behavior is due to the clock signal you are importing. What is the master clock signal that you are importing?
05-16-2018 08:31 AM
Hello Brain,
The clock signal I am importing from SPI master device. My sending data is not synchronizing with clock signal . Therefore I am loosing data which result in wrong data to be read at master spi device.
Thanks
05-17-2018 06:14 PM
If you have a service request open, it may easier to continue troubleshooting through that path. Could you further describe the clock signal? The DAQ device waits for a rising edge, so this could be due to your clock.