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.
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
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.
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.
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.
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.
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.
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...
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.
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?