From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

L6470

Does anyone have an example VI using USB-8451 with ST Micro Electronics L6470 micro stepping motor driver? I am new to SPI interface and very slowly learning how to use labview in conjunction with USB-8451 to use SPI for controlling the stepper motor. I attached the data sheets for the Eval board that is used to interface with the motor and the L6470 chip.

 

 Any help would be appreciated. I'm using labview 10.0.

Download All
0 Kudos
Message 1 of 8
(3,722 Views)

Hey wpn,

 

Are you using the SPI and I2C Driver API? It can be found here:

 

SPI and I2C Driver API - National Instruments

http://sine.ni.com/nips/cds/view/p/lang/en/nid/210637

 

This will have examples, such as One SPI Port with One Command Sent.vi, that may prove useful in getting started. If you have the driver installed then the examples will be located at <Program Files>\National Instruments\LabVIEW 2010\examples\IEIP\SPIandI2C. 

 

Hope this helps!

 

--Ryan S.

0 Kudos
Message 2 of 8
(3,691 Views)

Ryan

 

  Thanks for the help. But I am trying to use the USB 8451 to interface the controller via SPI. I found a couple of examples and currently working communicating with the controller.

 

 Thanks again.

0 Kudos
Message 3 of 8
(3,683 Views)

Ryan 

 

  After going through the manual for the L6470, I learned that I need to toggle the CS line at the end of each byte.

 

- CS high --> low

- send x25 (command address)

- the output should be x00

- CS low -> high

- CS high -> low

 

- send x00

- the output should be x00 

- CS low -> high

- CS high -> low

 

- send x00

- the output should be x8A (actual response)

- CS low -> high

 

The parameter I am trying to read is a 12 bit, so looks like I need to send x00 command twice to get the actual response bytes.

 

None of the examples that ship with 8451 does multiple command sequence in the scripting. Can some one please help me here with a sample programm.

 

thanks 

0 Kudos
Message 4 of 8
(3,673 Views)

Hey wpn,

 

There may not be an example for exactly what you're trying to do. However, based on what you're trying to do, it sounds like scripts are the way to go. You mention the shipping examples but have you looked at the General SPI Write Script.vi example? It can be found in the Example Finder by, from LabVIEW, selecting Help >> Find Examples. Then, once in the Example Finder, navigate to the example by selecting Hardware Input and Output >> I2C and SPI >> SPI Advanced >> General SPI Write Script.vi. You may need to modify this example to accomplish your exact needs but it should get you started. Hope this helps!

 

--Ryan S.

0 Kudos
Message 5 of 8
(3,660 Views)

Ryan

 

 I figured it out. Thanks for the help.

0 Kudos
Message 6 of 8
(3,657 Views)

Hi sir 

Could you please send me examples you mentioned ?

I m trying to communicate sbRIO9637 board with mcp3201 but I couldn't could you please help me ?

0 Kudos
Message 7 of 8
(3,098 Views)

Hi gnrttr,

 

You should be able to follow the instructions posted to find the examples mentioned. If you're still having trouble, I recommend creating a new forum thread, as this one is several years old and a new thread will be more visible.

0 Kudos
Message 8 of 8
(3,081 Views)