From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
09-01-2014 03:11 AM
I am using cRIO-9023 and Chassis 9112 with NI-9401 Digital I/O card for the SPI. I want to integrate the SPI GYRO sensor module but unable to make the Chip Select LOW. I am using the SPI_SINGLE_PORT_EXAMPLE have changed the RT controller to my desired controller and added the FPGA modules too. To start the SPI interface it is mandatory to make the CHIP SELECT ACTIVE LOW so that the SCLK may be generated then a 8 bit data is written and then wait for the READ data, when communication is finished the Chip Select may go HIGH to end communciation.
I have read the document at URL: https://decibel.ni.com/content/docs/DOC-7945
but unable to make the chip select low, can somebody make me correction where I am making a mistake .
Thanks
Ather Iqbal
09-02-2014 03:23 AM
Please check the 9104 I/O settings. You have to set the IO's direction either in the project settings (module properties) or in your FPGa code via property nodes.
I suppose your CS IO is set to input. So check that.
Hope it helps
Christian
09-05-2014 12:30 PM
I have change the IO pin of CS. But unable to read the correct data, how to get the correct data, The device which I am communicating is a GYRO, I am writing data to the GYRO's register in Hex '0F' then 0 nad then makeing the CS high, but getting the same data or FF, which is not the correct form of data
Kindly help me out
09-08-2014 05:54 PM
Hi Ather,
Since you are simply using a digital output module for this SPI communication, you can just invert the digital value that you are sending to the I/O Node in the FPGA code. If you look through the SPI example code that you linked above, there is a part of the FPGA code where they write the Chip Select State to an I/O Node to be outputted. You should just be able to invert the logic there to change from ACTIVE HIGH to ACTIVE LOW.
Regards,
Ryan
09-09-2014 03:23 AM
Don't know what the communication scheme of the Gyro is. I suppose you send a command and then you'll get the data. So you will need a communication timing between request and receive. What type of Gyro sensor is it?
09-09-2014 01:17 PM
Its Pmod Digilent GYRO L3g4200d
09-10-2014 01:40 AM
I think you'll need level shifter. The Gyro has a 3V (Low voltage-compatible IOs 1.8 V) supply and the NI9104 works at 5V (needs 2V min for a high level signal).
09-10-2014 12:47 PM
I've used voltage shifter IC, but I've uploaded the data sheet fot the SPI timing diagram reference
09-10-2014 01:45 PM
I (and NI) recommend using this SPI driver http://sine.ni.com/nips/cds/view/p/lang/en/nid/210637
Have you connected an oscilloscope to look at the actual state of the lines? Can you get a capture of that data and post it? With the SPI implementation linked above, if I remember correctly you read and write concurrently, so if you need to write to the bus and then read from it while holding the chip select line active, then you need to include empty bytes at the end of data to write, which will then become the data you read.
09-10-2014 02:15 PM
... or the Example you have started with fails to set the I/O direction when switching form read to write. If the output is tri-state ...
Ben