NI Home > Community > NI Discussion Forums

Components

Reply
Member
jako123
Posts: 6
0 Kudos

Re: 回复: SPI Digital Waveform Library - DAQ 6534

hi SysEngEric + David S!

 

SysEngEric - thanks for the info!

 

David S - I still think that there must be a way to change the vi's to work with the DAQ6534. Maybe we have to feedback one output signal to an input signal to be able to trigger an event?

 Or is the effort to big?

 

thanks + br

jako

 

 

 

 

Active Participant
David S.
Posts: 425

Re: SPI Digital Waveform Library

Hi Priyatham -

 

If that's the case, then you may indeed be able to use your 6551. As I said in my previous post, "You could try to use the scripting engine to generate a series of single-bit waveforms in response to a repeated falling-edge (or rising-edge, for SPI modes 1 and 3) trigger. I don't know whether the trigger holdoff time or other device limitations would play into the performance of the system...[A]ny time you import the SCLK signal as your sample clock, you won't be oversampling anymore and cannot use the SDW library to generate your data."

 

You would be using the SCLK signal as a trigger here instead of a sample clock, but the last sentence is still true: the SDW library has no use for you in the configuration I suggested, because you'll be using tiny waveforms that each only represent one bit in the serial data stream. You don't need to control the timing between data bits or the assertion/deassertion of the CS line.

 

So try it out, and let us know whether it works!

David Staab, CLA
Staff Systems Engineer
National Instruments
Member
Priyatham
Posts: 24
0 Kudos

Re: SPI Digital Waveform Library

Hi David

 

Thankyou for the reply, that's a relief. Now let me make sure I understand it correctly. I have to set my HSDIO to acquire the SCLK from the DUT. I then have to use the negedge(for my application) of this signal as a trigger for the generation engine. The generation engine should be able to react to the trigger and generate the bit vectors that were previously loaded onto the onboard memory. Please correct me if I'm wrong somewhere.

 

Also I know how to use a generation engine to trigger the acquisition engine (via DataActiveEvent), but Im not sure how to do vice versa. It would be a great help if you can provide an example.

 

Thanks,

Priyatham.

Member
jmax007
Posts: 16
0 Kudos

Re: SPI Digital Waveform Library

I am also trying to use PCI-6229 as master SPI to communicate with a microcontroller. I have read through the "Serial Protocol Communication Reference Design for Digital Waveform Devices" and downloaded the example, but I cannot get it to work properly. It seems to be missing one .vi from the utilities folder

"Get Terminal Name with Device Prefix.vi"

I am new to LabVIEW, so I may be missing something obvious, but I would like to view/run the example so I can understand and modify it to suit my application.

Thanks

Jamie

Active Participant
David S.
Posts: 425
0 Kudos

Re: SPI Digital Waveform Library

Hi Jamie -

 

Where Can I Find Get Terminal Name With Device Prefix VI?

David Staab, CLA
Staff Systems Engineer
National Instruments
Active Participant
Jordan F
Posts: 220
0 Kudos

Re: SPI Digital Waveform Library

Hi Jako,

 

The 6534 does not support the Data Active Event (which was referenced earlier) so, you are correct in that you will need to use a data line to synchronize the two tasks.  This can be done by appending a digital signal to the digital SPI waveform that contains a data high (1) in the beginning followed by enough zeros to match the length of the digital SPI waveform.  Then you would need to route this signal to a PFI line to trigger your digital input task. 


You can modify the digital signal in the SPI Close VI and using the Append Digital Signals VI.  Remember though, if you add waveforms you need increase your channel count to account for this.

 

The example is built for the 6535/6/7 boards but you could try this out to see if you can get it working with your device. 

 

Regards,
Jordan F
National Instruments
Member
Priyatham
Posts: 24
0 Kudos

Re: SPI Digital Waveform Library

Hi David

 

I'm having one issue with the code you posted for SPI via HSDIO. I have been trying to modify it to my needs and somehow in the process I lost the acquisition from MISO.  I have tied MISO to a toggling signal via AWG and it stays at 1 instead of acquiring that signal. It used to acquire and toggle before.

 

So I tried downloading a fresh copy of your code thinking it would solve the problem, but it didnt either. I'm attaching the code, can you please check it and let me know what the problem is?

 

Thanks,

Priyatham.

Active Participant
David S.
Posts: 425
0 Kudos

Re: SPI Digital Waveform Library

Hi Priyatham -

 

Your code looks functionally identical to v1.0.1 of my "HSDIO SPI - Core Features" VI. I'm comparing the diagrams side-by-side, and there's no difference between them. I can only offer some suggestions:

 

  •  Your comments and VI icon suggest you want this to be an 8-bit exchange, but you're still generating a 16-bit waveform. Change the representations of the "Output" and "Expected Input" controls to U8 if you want to use the 8-bit instance of the "SDW.lvlib:smileyfrustrated:wap" VI. (Alternatively, you can make the polymorphic selector visible and manually choose your instance.)
  • This example is not designed for a muliti-slave bus configuration. (I chose to keep the code as simple as possible, instead of supporting all potential uses.) If you have more than one slave device on the bus, you'll have to modify the code to generate multiple CS signals.
  • Probe the pins with an oscilloscope to make sure you have them wired to your slave device correctly. The order of signals gets switched around in some of these function calls, and the actual pin mapping on your HSDIO device may be different than the one you expect.
  • If you ended up modifying any of the subVIs, I won't be able to see your modifications because you only attached the top-level VI. It's calling into subVIs on my system, which could be different than the ones on your system.
    • Note: If you choose to modify the SDW library VIs, I can't fully support that effort. I can offer suggestions on how to modify the subVIs for custom scenarios, but the actual process of modification will be on your shoulders.
David Staab, CLA
Staff Systems Engineer
National Instruments
Member
Priyatham
Posts: 24
0 Kudos

Re: SPI Digital Waveform Library

Hi David

 

Thanks for the reply -- at one point I had modified them to be 8 bit , but I changed it back to 16 bit. Right now I dont have my Slave device yet, so Im just trying to force a pulse wave via an AWG on to the MISO, and I can't get it there. My biggest concern is that I might have modified some sub VIs unintentionally, so its not working. For my purpose I dont need to modify any SDW Library VIs. I have tried to uninstall SDW library and install it again so that I have the unmodified ones, but that didnt work either. Now I'm thinking if I have modified any of the HSDIO VI's unintentionally. First pass I wanted to check if the problem is because of the top VI itself or any of the sub VIs. Is there any easy method to do this? Thanks for your help.

 

Priyatham.

 

 

Member
Priyatham
Posts: 24
0 Kudos

Re: SPI Digital Waveform Library

Hi David

 

Thankyou so much for all your help. I have figured out the issues I had before. now I just got one issue regarding being able to act as a SPI slave. The issue in simple words is that, I want to trigger the generation engine on a signal while acquring the same signal. I want to start the dynamic data generation engine(SPI Slave dataout) on the chip select trigger, but at the same time I also want to acquire that signal so that I can view it in a graph along with the other acquired signals. To acquire a signal it should be connected to a DIO line and I cannot trigger my generation engine from a DIO line - to trigger, I should connect it to one of the PFI lines and I cannot acquire from a PFI line. Is there any way around this? One other reason why I do not want to connect that signal to the PFI line is that the PFI line is pulling it low when that signal actually has a pull - up. Is there any way to make a PFI line High Z?

 

Thanks,

Priyatham.