Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

need help on USB 6008

Hi, could anyone give us some LabVIEW example on using USB 6008? Our question is as follows:

We are using a USB 6008 DAQ to inject our control signals into a scan-chain consisting of up to 500 registers built in our chip. The scan-chain has two non-overlap clocks (TCK & TCK2) so that the input signal (TDI) will not face a risk. The scan-chain also has a output signal (TDO) but we may not need to use it. So, in general, we want to inject a set of 0/1 signals, sampled by two non-overlap clocks, into our scan-chain each time before we test our chip. The problem is that we need to inject up to 500 numbers, so it seems inconvenient to use LabVIEW signal generator? Maybe we need some other softwares, say, MatLab, to co-work with LabVIEW? Unfortunately we are new to LabVIEW and NI DAQ, and we fail to find good examples, especially some helpful codes, from the help manual. So, could anyone give us some advice? We appreciate it very much!

-Tao
0 Kudos
Message 1 of 20
(4,933 Views)
Hello Tao,

It looks like your going to be using some Digital Input / Output and possibly some Analog Input / Output to control the scan chain on your IC.  We don't have any specific examples made for this appication, but we have a variety of shipping examples that you could start from.  By going to Help » Find Examples, you have access to all the DAQmx shipping examples.  I would navigate to Hardware Input and Output » DAQmx and look at the digital and analog shipping examples.  These examples will help you get started controlling your DAQ card.  There are also a variety of examples that can be found by going to our website here and searching the entire site.  On the search results page, you can narrow your search to only include example programs.

If you have any more specific questions, could you elaborate on how you will be using the USB 6008 inject numbers to the scan chain.  Do they have to be injected at a specific rate? Were you planning on using the digital output, analog output, or possibly a counter task to accomplish this? When you say you want to inject a set of 0/1 signals do you mean 0's and 1's as in digital logic or two different signals? 

Thanks,
Paul C.


Message Edited by Paul C. on 11-12-2007 04:43 PM
0 Kudos
Message 2 of 20
(4,914 Views)

Thanks, Paul. I have read those examples before, but when thinking about our project, I still have no idea.

Generally, we just want to inject a set of 0's and 1's in digital logic one by one into our DTI port of scan-chain. So I think the rate is not so important, we just want to make sure that before we get our chip on power, each register in the scan-chain is set to an appropriate state. We need not use analog port, and we plan to use digital output to generate two non-overlap clock to sample. I think if we can creat an array of 0's and 1's and input this array and the clocks to a specific port, it will be OK. However, we have not found out how to generate a series of logic signals (up to 500 bits) and two clocks by LabVIEW. Could you give us more help on this? Thanks!

-Tao

0 Kudos
Message 3 of 20
(4,907 Views)
Hi Tao,

Unfortunately, the USB-6008 doesn't have dynamic Digital I/O.  You can only do software timed output.  Were you planning on using software timing to time the digital output non-overlap clocks or were you going to use external circuits to break up a counter output (digital pulse train) into the two non-overlapping clocks?  I would like to mention that the accuracy of a software timed clock is system dependent and may not be possible at millisecond or faster speeds.  In addition, I would like to mention that the speed you could create these clocks would depend on the fastest portion of the signal (I'm assuming the point where both are switched low prior to one going high - essentially, where the lows overlap).

I also wanted to make sure that I fully understand how you will need to implement the non-overlap clocks.  Here is a picture of how I visualize these clocks.  Take a look at the bottom of the page and tell me if that is what you're going to implement.  Once again are you going to need to generate both of those pulse trains with a digital output line or are you going to do it with external circuits (where you provide a clock to it and it splits it into two clocks)?

I'd also like to mention that it would be fairly simple to build a LabVIEW program to output a series of 1's and 0's on a line or port.  All you need to do is run a for loop that  will index an array and output a portion of the array every iteration of the loop.  For example, I made a simple example that counts on the digital lines from 0-15 (0000,0001,0010, etc.).  The code I used is shown below.



I hope this helps you get started,
Paul C.

Message Edited by Paul C. on 11-13-2007 02:56 PM
0 Kudos
Message 4 of 20
(4,881 Views)

Thanks, Paul. We are planning to use software timing to time the digital output non-overlap clocks (use LabVIEW and USB 6008), and the link you provide exactly describe what we want to realize. We won't use external circuits to generate clocks. We can accept low speeds, we just need to inject the set of 0's and 1's into our scan-chain before test.

I see your LabVIEW block, it's very helpful. Thanks again. But we still need two non-overlap clocks to sample it. Is there any functional blocks in LabVIEW to create some pulse signals whose duty cycle are less than 0.5?



Message Edited by smthiid on 11-13-2007 10:09 PM
0 Kudos
Message 5 of 20
(4,864 Views)
Hi Tao,

It shouldn't be too difficult to program the non-overlapping clocks.  Basically, you need to use multiple DAQmx write vis to switch the two clock lines to generate the non-overlap clocks.  This can be accomplished through a state machine.  I've gone ahead written a slow example of how to output two non-overlapping clocks on the first two lines of a port such as port 0.  All it does is change the outputs low for 1 second, change one output high for 3 seconds (this is done by sending a 1 or 00000001 to turn the first line high), change them both low again for 1 second, and finally send the other line high for another 3 seconds (00000010).  By repeating this you can see that lines 0 and 1 will be used as the clock.  Here is a picture of the block diagram of the example.



I hope this helps,
Paul C.


Message Edited by Paul C. on 11-14-2007 01:36 PM
Download All
0 Kudos
Message 6 of 20
(4,842 Views)
Thanks, Paul. I got your idea and I think it is very helpful and makes sense.
However, when I run the block diagram and use oscilloscope to see its output, I cannot see the waveform I expect. I only got some pulse, and then it dropped at once. I am not sure what the problem is, and I am not sure whether I used the oscilloscope correctly. The waveform is so weird that I cannot believe it.
I want to add a graph indicator in the block diagram so that I can see the waveform in the LabVIEW, however I tried but failed. I cannot see the waveform. Could you tell me how to add the graph indicator? Clearly it cannot connect the task out, so I can only connect it to the data line, in each state. But it doesn't work, I have no idea.
I really appreciate your help.
0 Kudos
Message 7 of 20
(4,800 Views)
Sorry I forgot to attach my vi file in the last post.
0 Kudos
Message 8 of 20
(4,784 Views)
Hi Tao,

In the VI I wrote, I used a while loop to generate the non-overlapping clocks continuously.  In your program, you are only going to generate the clock the amount of iterations of your for loop.  In addition, it is important to note that it will take 4 iterations of the for loop to generate the pulses of your non-overlapping clocks (essentially one period).  I've gone ahead and attached a picture of the clocks.  I have also verified that your code does work (for the number of iterations of the for loop) for creating the clock as shown below.



I would like to add that this was generated using test panels within Measurement and Automation (MAX).  I simply connected the digital output lines to analog inputs and read them in as referenced single ended (RSE).  There is really no way to create an indicator to show exactly what is being outputted without manually doing so.  I would just suggest reading it back in with an analog input if you want to verify the signal.

I hope this helps,
Paul C.


Message Edited by Paul C. on 11-16-2007 03:31 PM
0 Kudos
Message 9 of 20
(4,770 Views)
Thanks, Paul. Your advice helps a lot. I am putting my vi file in this post again and it seems to work well. However, there are still something I am not sure.

1) When I write the case-structure, I assume that the output should be: both lines are low for 100ms, then one high for 300ms, then both low for 100ms, then the other high for 300ms. However, when I look at the results in the graph indicator reading from the analog input connected with the digital output, I find that things are different from what I expect: both lines are low for 100ms, and then one high for 200ms, then both low 100ms, then the other high 200ms. Am I understanding the case-structure wrong?

2) Now I am using a seperate while-loop to output the series of 0's and 1's, and the period is 600ms (not 800ms I used to expect). I found that if I put the case-structure in the for-loop, I would not get the non-overlap clocks I want. However, if I want the non-overlap clocks stop to generate once all the data I want to inject the scan-chain have been injected, what should I do to control the two while-loops?

3) When I use this USB-6008 to inject digital numbers into my device, need I make them common grounded?

Thanks very much,
Tao






Message Edited by smthiid on 11-18-2007 05:22 PM
Download All
0 Kudos
Message 10 of 20
(4,738 Views)