05-09-2012 12:33 PM
Intro:
I have a Single Board RIO 9605 which I want to use to communicate with a SPI based sensor. I have read through how to implement SPI onto a Labview FPGA (http://zone.ni.com/devzone/cda/tut/p/id/9117), and I have used the same (and other) example codes as a baseline to set up the communication. Basically the tricky thing is to convert the example code to another FPGA target than the one which is used in the example. So since I am here on this forum I obviously do not get it to work.
What's the problem?:
I do not get any response from the Slave sensor.
After many hours of troubleshooting I have come down to one logical reason. I have used a digital analyzer to look at the different signals. It seems like the Master Output signal (MOSI) is working. Data is streaming nice and steady. But I do not get any clock signal (SCLK). In order for the slave to send data back to the master it needs the SCLK to clock out the data. So for me it is a logical explaination why the slave is not responding.
In order to isolate the problem I have removed the sensor and I have looked at the SCLK signal directly on the Mezzanine connector on the sbRIO-card. No clock signal is found.
Next question would be if I have not configured the IOs correctly. I have configured the IOs according to the document above, and I have double checked the Vis and sub-VIs to see if I have forgotten anything. Since I get the MOSI and CS signal to work, I find it strange that the SCLK signal is not working. I have allocated the SCLK to DIO5 on the sbRIO. I have compared the configuration between the MOSI and CS channels, and they are identical to the SCLK channel.
Main question:
Is there any explaination to why the sbRIO 9605 do not provide the clock signal SCLK on the digital IO?
Generally I have tried to keep as much of the original example codes and configurations as possible, to avoid too many points of possible failures.
Cheers
Stackbuster
05-09-2012 01:14 PM
Hi Stackbuster,
It sounds like you have done the right things to port this code to your new target.
In the spirit of debugging, I have a couple ideas to try, since I can't see anything obviously wrong from your description.
First, I have to ask, can you double check (probably triple or quadruple check at this point 🙂 ) that you are probing the correct DIO pin on the RMC connector. It is a high density connector and it could be easy to miswire.
If you are sure you are the correct pin, can you associate the SCLK signal with a different DIO line and recompile to see if it changes the behavior? I want to rule out the possibility that the DIO5 pin you are using is damaged.
I've used this IP in the past and seen it work, so we should be ablet to find the problem and overcome it.
Cheers,
05-16-2012 02:56 AM
Hi Spex,
Thank you for your quick reply.
Yes, as I wrote that first message I started to think about the same thing; to associate the SCLK to another DIO. So I have done that and it now seems to work. I have not tried it towards the sensor yet, cause I have too re-route the connection on the high density connector.
If I'm stuck I will let you know.
Thanks.
Cheers
Stackbuster