LabVIEW Embedded

cancel
Showing results for 
Search instead for 
Did you mean: 

Use LabVIEW Embedded Module for ARM Microcontrollers to read data from SPI interface

Hello,

I just got "
60-Day Evaluation Kit,LabVIEW for ARM Microcontrollers -ARM7(MCB2300)

My first step is to read data from a temperature sensor (spi output interface) and show the data either to the host pc or LCD on the board.

I found there are many SPI functions provided by Labview ARM Module such as *ARM SPI Create Configuration Reference VI*

But still not sure how to use those functions to complete my task. For example, about the function mentioned above, how to set *chip select *
value?
0 Kudos
Message 1 of 55
(17,139 Views)
Hi,

The "chip select" input to the ARM SPI Create Configuration Reference VI selects a SPI interface on the microcontroller.
--
Michael P
National Instruments
0 Kudos
Message 2 of 55
(17,135 Views)
Thank you! But I still don't quite understand, any examples about how to use those functions? I have read all examples in "LabVIEW 8.5\examples\lvemb\ARM\MCB2300" folder, but still don't find any help.
0 Kudos
Message 3 of 55
(17,131 Views)
Hi liberty,
 
Currently, no SPI examples ship with the LabVIEW Embedded Module for ARM Microcontrollers.  Recently, I am the engineer that has been given the responsibility to create those shipping examples.  I will try to post an example for you within the next week.
 
Regards,
Kevin S.
Applications Engineer
National Instruments
0 Kudos
Message 4 of 55
(17,106 Views)

I am also looking at implementing an SPI interface, in my example it is to log gyroscope data.



Message Edited by p.dalgoutte on 07-01-2008 10:18 AM
0 Kudos
Message 5 of 55
(17,058 Views)
Hi everyone,
 
No, I have not forgotten about the example.  It is in the works.
 
Kevin S.
Applications Engineer
National Instruments
0 Kudos
Message 6 of 55
(16,959 Views)
Hi Kevin
 
Hope to see your example soon.
 
What I found is the labview "ARM SPI Create Configuration Reference VI" function doesn't set arm registers as what I expected. I need to set that SSEL pin as GPIO pin so that I have more software control ability. To be specific, I need to write
PINSEL1 |=  0x0000003C;    
not PINSEL1 |=  0x0000003F showing in the file ARM_SPI.c the labview generates.
 
Also, I need to control the pin P.18 to set it either high or low through labview interface in order to successfully read data from my sensor (I succeed reading data through Keil uVision).
 
Thanks!
0 Kudos
Message 7 of 55
(16,903 Views)
Hi liberty,
I don't know if you're still working on a SPI bus example for the MCB2300, but I have a semi-working example.  The only item holding me up is the fact that the MCB2300 outputs a chip select logic level that is active high, but my external device accepts a chip select logic level that is active low.
 
I wrote an with the LabVIEW Embedded Module for Arm for LabVIEW 8.5.1.  (Let me know by replying to this post if you're interested in downloading the example.  When I know that you're available, I can post the example to an FTP server for a week.)
 
Special note: When using the Chip Select 0 (as I did in my example), the connecting pins on the MCB2300 are the following.  See the first image on these datasheets for more information.
SCLK0/SCK: pin 89
SSEL0/CS: pin 90
MISO0: pin 87
MOSI0: pin 86
 
I hope this helps.  Of course, depending on your external chip, you will need to taylor your commands to communicate with your device.
 
Regards,
Kevin S.
Applications Engineer
National Instruments
0 Kudos
Message 8 of 55
(16,811 Views)
Hi, Kevin
 
Thank you! That's also the problem I faced before! But when I set SSEL pin (pin 90) as GPIO through uVision software so that I can control spi like :
 
1. SSEL=low;
 
2. write_to_spi;  //write command to choose the sensor register address
 
3. read_from_spi;  //read data from  the sensor register dedicated; if  the  SSEL already  goes high after "write_to_spi" process, the sensor stops to output data//
 
4. SSEL=high;
 
and it works but I just not sure how to use labview to do this job. I'm definitely interested in your example and thank you again!
 
 
0 Kudos
Message 9 of 55
(16,809 Views)

Hi liberty,

I have posted my simple, example program (spi arm.zip) at this site: ftp://ftp.ni.com/outgoing  (It will be available for 48 hours.)

For those who come across this posting after the 48 hours, here are screenshots of my example program.  It's written for the MCB2300 using the LabVIEW Embedded Module for ARM, version 8.5.1.  This example shows how to communicate between the MCB2300 and an external SPI (Serial Peripheral Interface) bus device.

I implemented a simple command to read from my external device.  You'll have to tailor the command you send depending on your external SPI bus hardware.

Kevin S.
Applications Engineer
National Instruments



Message Edited by Kevin_S on 07-29-2008 10:18 AM
Download All
0 Kudos
Message 10 of 55
(16,782 Views)