07-23-2007 07:50 AM
07-23-2007 10:07 AM - edited 07-23-2007 10:07 AM
Hi Migueles-
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
11-06-2007 02:08 PM
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.
11-06-2007 03:31 PM
Hi ILLGG-
Here's the same VI, saved for LabVIEW 8.0.
11-09-2007 02:14 AM
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!
11-09-2007 09:44 AM - edited 11-09-2007 09:45 AM
Hi ILLGG-
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.
Thanks-
11-09-2007 12:46 PM
Hi Tom W:
Thank you for the help. i have a question about your vi: what is the :"data in line" for?
thank you.
11-09-2007 12:49 PM
Hi ILLGG-
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.
11-09-2007 12:50 PM
11-09-2007 12:57 PM