LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

SPI Example Not Working (SCLK, MOSI, CS)

I have been working with the single port SPI example. I have it ported to a cRIO-9075 with a NI 9401. In the example there is a pin used for an enable bit for a motor. I set this up to test and am getting an output on this pin. The other pins for SCLK, MOSI and CS are not active at all. I have tested them all on an oscilloscope.

 

The I/O is mapped as follows:

 

SCLK -DIO0

MOSI -DIO1

MISO -DIO2

CS1 - DIO5

CS2 - DIO6

Motor - DIO3

 

The next thing I was going to try was remap the I/O to see if Labview would plausibily update them. I am completely not sure why it isn't working. I am relatively new to Labview, but am a seasoned programmer. Any suggestions?

0 Kudos
Message 1 of 13
(4,098 Views)

Hi squared,

 

What SPI example are you specifically using for this application?  In the future, what device will you be communicating with?  Can you toggle the inputs and outputs on the module if you do not use the SPI example?  Thanks for the additional information!

 

Kira T

0 Kudos
Message 2 of 13
(4,081 Views)

Kira,

 

Thank you for your reply. I am using the single port example from the following link: http://www.ni.com/white-paper/9117/en

 

I am communicating with a TI DAC8811-EVM. I have been looking at the singles when it has been attached and unattached to the module. I have an oscillosope I watching the signals with

 

I haven't created just a project to create outputs on the module. I have been trying to use the same project, but use the extra pins to output. What I have now is I can do a forced state change on DIO3 in the project with SPI. I am working on the others. It takes a while for the bitfile to be created for the FPGA.

 

After I got the output I switched one of the SPI to that location. I have been first looking at the CLK signal, which is not coming through.

0 Kudos
Message 3 of 13
(4,079 Views)

Hi Squared,

 

How are you changing the mapping?  What happens if you open the project and run it as is with out chaninging the mapping?  

 

Thanks,

Kira T

0 Kudos
Message 4 of 13
(4,061 Views)

By renaming the I/O to the specific calls in the program. For instance, if SCLK started at DIO0 it can be moved to DIO3 (which was working by toggling the output). After renaming it requires rebuilding the FPGA bitfile. Then launching the applicaiton.

 

If I leave it the way it is now. I have the values that I have mapped to where they can be toggled and the others assigned to the SPI will do nothing. No matter what I do with the inputs to the functions. No matter what I do with the I/O mappings I get the same response from the SPI code. Nothing.

 

Michael

0 Kudos
Message 5 of 13
(4,059 Views)

Hi Michael,

 

Im sorry to keep asking you questions about this.  But, to better clarify, are you changing the the project here:

 

 

2012-09-14_165830.png

 

And are you changing it here as well:

 

2012-09-14_165830.png

 

Is it possible for you to post your project with all of the changes that you have made?  Thanks.

 

Kira

 

0 Kudos
Message 6 of 13
(4,044 Views)

Hi Kira,

 

No problems about asking questions. Yes, indeed those are the places the I/O was being changed. And still to no avail.

 

Yes, I will upload the project.

 

Thank you for looking,

 

Michael

0 Kudos
Message 7 of 13
(4,025 Views)

Hi Michael,

 

I noticed that you were setting everything to True rather than false, is there a reason you have made this change?

 

Thanks,

Kira T

0 Kudos
Message 8 of 13
(4,005 Views)

Kira,

 

I forgot I had done that and didn't change it back. I was trying to get the pins to change static states. Instead of active low have them active high. Just to see if they would output a voltage high sitting there. I have been trying everything plausible to see where it might not be working.

 

Michael

0 Kudos
Message 9 of 13
(4,003 Views)

I am just trying to see the signals come out. That is my first step. Then I will worry about if it is correct to connect to the DAC I am attaching it to.

 

Michael

0 Kudos
Message 10 of 13
(4,002 Views)