Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

SPI interface

I have a PCI-6024E that I'd like to use to communicate with some SPI devices. I would like to implement an SPI interface using the PFI lines but could use the DIO and counters if I had to? I2C is another option if that is more feasible.
0 Kudos
Message 1 of 16
(6,376 Views)
The DIO lines on your DAQ board probably do not have the hardware timing ability to do an SPI interface.

Check out these links that give you a little more information:

These shows how you can do an SPI interface with our CompactRio products (instead of your DAQ board):

http://sine.ni.com/apps/we/niepd_web_display.display_epd4?p_guid=E6206891F0AA3C3FE034080020E74861&p_node=201043&p_source=External

http://zone.ni.com/devzone/conceptd.nsf/webmain/d3955e49973bcdbf86256f290077a761?OpenDocument

These shows how it might be possible with our high speed DIO boards:
http://forums.ni.com/ni/board/message?board.id=70&message.id=1108&requireLogin=False
http://forums.ni.com/ni/board/message?board.id=250&message.id=8001&requireLogin=False

Regards,
Anuj D.
0 Kudos
Message 2 of 16
(6,355 Views)
I have seen both the spi bus and I2C bus protocal implemented with jsut digital I/O. the card were the basic 48H or 96H which are only DI/O with no clock. You basically have to set each line for the bus in the order of the timing diagram for your chip. The implemention I am used to uses inport and outport for the digital I/O control to speed up the process. There are definitely faster methods but a pure DI/O method will work.
0 Kudos
Message 3 of 16
(6,076 Views)

Terrill

I am in the process of trying to implement an SPI interface using a 6533 DIO card.  I have two ports available at this time on the card.  Any tips on doing the interface this way?  I am a fairly new user so any advice is helpful.


Bob
0 Kudos
Message 4 of 16
(5,982 Views)
Here is an example of using inport and outport. The was written about 8 years ago so excuse the coding style. It should be good enough to demonstrate the point. SPI Read-Write.vi is the top level vi. If you check any spi device datasheet you will see that the lines controlled are set in specified order. Note that inport and outport use the memory address of the card. These vis were used to speed up the process as we programmed serial eeproms. These vis operate on byte data (8 bits or 8 lines at once). You will see all writes read the port and then change the value of line that need to change and then writes all 8 lines of data. If speed is not an issue and you have a driver for your card just write and read the exact lines in the exact order as commented in the block diagram. It will be slower but probably easier to follow. If you know the pc address of the card this code might work with the correct address values. One last note, many chips have chip enables that will also have to be set. Let me know if you need anything explained. Hope this helps.
0 Kudos
Message 5 of 16
(5,970 Views)
I was not familiar with that card so I looked it up. What are the PFI lines you stated. I see analog IO, digital IO,and some timers. I hate it when NI forces NI-DAQ as a driver. If you use NI DAQ to control it you will have to write or read each line individually. If it is too slow look in windows device manager for the address and try the inport outport method.
0 Kudos
Message 6 of 16
(5,966 Views)
Hi

Just for information: NI has a USB Interface that provides I2C and SPI communication and in addition it includes 8 general purpose DIO lines. It's called NI USB-8451.

Regards,
Luca

Regards,
Luca
0 Kudos
Message 7 of 16
(5,931 Views)
Hi, I've got a PCI DIO-32HS card and i would like to simulate an SPI (or I2C) to communicate with some other devices. Does someone think that it is possible to use this board or do I have to get a CompactRIO?
Sorry for my english...


Message Edité par tridardp le 01-10-2008 10:34 AM
0 Kudos
Message 8 of 16
(5,195 Views)
You can simulate that communication with any DI/O card or even a serial or parallel port. The only difference will be the speed of the communication. If you need a very haigh data rate then different hardware would be needed.
0 Kudos
Message 9 of 16
(5,190 Views)
Thanks for you previous answer, but I've got an other one. I read that there is a specific NI board (8451) which exploit dedicated libraries (called NI845x) to communicate by SPI or I2C. Do similar libraries exist for the NI-6533 device ?
If it doesn't do you think that it should be smarter to buy the 8451 instead of spending time to reinvent the SPI communication protocol?
0 Kudos
Message 10 of 16
(5,151 Views)