NI Home > Community > NI Discussion Forums

Components

Showing results for 
Search instead for 
Do you mean 
Reply
Active Participant
David S.
Posts: 425
0 Kudos

Re: SPI Digital Waveform Library

Hi jigsaw -

 

The ZIP file contains a Windows installer. Unzip all contents to a folder, then run the EXE file to install the component. It includes a user.lib API and an example program that gets installed to <lvdir>/examples/SPI Digital Waveform.

David Staab, CLA
Staff Systems Engineer
National Instruments
Member
jigsaw
Posts: 2
0 Kudos

Re: SPI Digital Waveform Library

Thanks it must have been the saturday midnight thing, because I can clearly see that it says where to find it.

 

Question about the oversampling clock. Does the oversampling clock take the place of the sampling rate? I will be using the PXI-6229 (hardware not in yet)

 

 

Active Participant
David S.
Posts: 425
0 Kudos

Re: SPI Digital Waveform Library

Hi jigsaw -

 

The Serial Protocol Communication reference design will help you get this component running with your M-series board. To directly answer your question, yes the Oversample Clock input should be provided with the rate of your DAQmx Sample Clock.

David Staab, CLA
Staff Systems Engineer
National Instruments
Member
Robo_mike
Posts: 1
0 Kudos

Re: SPI Digital Waveform Library

When I try to download sdw_1_0_1_lv85.zip, i get a server error saying:

 

ISA Server: extended error message :

200 Type okay.
500 Illegal PORT command

I also get this error when i try to download the zips for 8.2 and 8.6.

 

Is this an error with NIs server? How else can i download this library?

Active Participant
David S.
Posts: 425
0 Kudos

Re: SPI Digital Waveform Library

Hi Robo_mike -

 

This is a problem that needs to be reported to the webmaster. On the Contact NI page, please click the link to "Report a problem with ni.com" and fill in all these details you've shared with me.

David Staab, CLA
Staff Systems Engineer
National Instruments
Member
tlee16
Posts: 11
0 Kudos

Re: SPI Digital Waveform Library

Hi,

 

I'm using SPI library with 6552 and it seems working fine for a single device (ADIS 164xx sensor). But I'm having a hard time making it to talk with multiple devices. I am trying to read one device at a time (with CS = 0). Both Devices share SCLK, MISO, MOSI, with independant CS line. I think I know how it should be, but not sure how to implement this with SPI Libraray toolkit. Can someone please tell me how it should be changed to talk with multiple SPI devices? Many thanks.

Active Participant
David S.
Posts: 425
0 Kudos

Re: SPI Digital Waveform Library

Hi tlee16 -

 

It looks like you're trying to command two slaves in sequence. SDW can build a waveform to do this for you, but I think you're trying to manage the details yourself and that's getting things confused.

 

There are two software components in the application: The SDW VIs that build the digital waveform, and the Serial Protocol reference VIs that configure and command the HSDIO hardware. The recommended approach to communicating with two slaves in sequence is to configure the HSDIO hardware to implement a 5-pin bus (SCLK, MISO, MOSI, CS_1, CS_0), then build an SDW waveform that manages both CS lines at any given time.

 

To configure the HSDIO hardware, give it the indices of all four output lines (SCLK, MOSI, CS_1, CS_0) and the input line (MISO) on your bus. Don't worry about one of the CS lines not being used at any given time: SDW will manage that by writing '1's to the waveform to hold that line high when its slave isn't being addressed.

 

To address one slave or the other, change the value of the "Slave address" input on "Swap.vi" with each generated message. To address the slave on line "CS_0", set the value to 0. To address the slave on line "CS_1", set the value to 1. The Serial Protocol VIs will handle mapping that CS line to the appropriate HSDIO pin when the waveform is downloaded to the HSDIO board's memory.

 

Here's where you can find the "Slave address" control in your program. This is a screenshot of "Format to SPI.vi":

 

22821i529E0A9E25FD6735

David Staab, CLA
Staff Systems Engineer
National Instruments
Member
tlee16
Posts: 11
0 Kudos

Re: SPI Digital Waveform Library

Hello David,

 

I must be missing something because I am getting an error, number of signal in waveform doesn't match the number of assigned channels. I assigned CS0, CS1, MISO, MOSI and SCLK (pin 3, 5, 7, 9, 11).  I really appreciate your help.

Active Participant
David S.
Posts: 425

Re: SPI Digital Waveform Library

Hi tlee16 -

 

Referring to the same screenshot as my last reply, take a look at the "Digital Signal Subset" VI at the end: You're only passing a waveform with 3 channels to the "Run Core Device" VI. But you configured 4 channels for output on the HSDIO device. You'll have to write a 4-channel waveform to the device's memory.

David Staab, CLA
Staff Systems Engineer
National Instruments
Member
tlee16
Posts: 11
0 Kudos

Re: SPI Digital Waveform Library

Hi David,

 

I understand that and tried it (CS0, CS1, MOSI, MISO, SCLK - signals configured to 0, 1, 3, 3, it only supports 0, 1, or Z with 4 channels) but still gives a wrong data. Is [0, 1, 3, 3] correct configuration for the signals? With the single slave, it worked with [0, 2, 3]. Also what should I do with output initial/idle state input of 'Init Core Device.vi'? Should just copy 'not CS Active' string and feed in to output initial/idle state input of 'Init Core Device.vi'? It feeds in 1101 (CS_0, CS_1 active state, MOSI and CPOL). Thanks again!