The communication might be rather slow because the 6508 provides software-timed operation, but there's no reason that this shouldn't work. I mocked up an SPI example a while back that might help you get started (see attachment).
Hopefully this helps-
Message Edited by Tom W [DE] on 07-23-2007 10:08 AM
Hi Tom W:
I am really interested in your 6508 spi emulation vi. Howerer your vi version(8.2) is later than my Labview version (8.0). So I could not open it. Do you have some other similar examples written in 8.0 Labview version? I have a PCI-6221 and I want to control a digital potentiometer with 3-wire SPI serial interface. I just begin to learn Labview and I don' know how to do this. Thank you so much for your help.
Here's the same VI, saved for LabVIEW 8.0.
Hi Tom W,
Thank you for your 8.0 version of the example. I am thinking of modify your code for my project.
I have the digital potentiometer AD 5290. I want to control it using Labview via PCI 6221(DAQ). It contains 3-wire digital interface
CS:Chip select input ,active low.
CLK: serial clock input . Positive edge triggered.
SDI: 8-bit Serial data input. Shift in one bit at a time on positive clock CLK edges. MSB loaded first.
Can I have some advice on how to implement this? Thank you so much!
The example should almost work as shown. First, the "Data Out" line refers to the line you will use to shift data out to your peripheral. In order to clock on the rising edge, you'll want to change the "SPIClk Init
Condition" to False so that it will toggle high->low with each iteration of the loop. The only other thing you'll need to add is the CS line- I would implement this by performing a single point write to a digital line before entering the loop and then another single point write to clear the CS line.
I have attached my VI, modified to include a single point CS update task. Give this a try and let us know if you have other questions.
Hi Tom W:
Thank you for the help. i have a question about your vi: what is the :"data in line" for?
That line is for the case where you might need to perform a bi-directional SPI operation. In other words, where you clock in one bit to your peripheral on the rising edge of the clock and then clock out one bit on the falling edge. In the case where you need to clock in your entire input sequence before reading a response (for example, if you're clocking an address or command into the peripheral) you would actually need to seperate the two operations into two seperate loops. If you don't need that functionality you can simply remove it from the example.