LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Blackfin: Setting a pin to be a GPIO

Hi,

I am using the BF537 EZ-Kit Lite.  I want to communicate over the SPI port to a device.  This device has two additional connections, a data ready and reset (in addition to the normal SCK, MISO, MOSI and SSEL) which I can connect to free pins in the SPI or PPI if necessary.  In order to prepare the device to take a measurement, reset must be changed to low, high, then low.  This was an easy task in Visual DSP++ (setting a register that controlled the port pin three times), but I don't know how to do it using LabVIEW.  Once the measurement is ready, data ready goes high which would trigger an interrupt to take the data at the SPI port.

Questions:
How do I set pins to be GPIO pins?
Once I've done that, how do I write to a specific pin?
Also, how do I make a pin trigger an interrupt?
On a side note, are there any good references/examples on how to use the LabView SPI vi's? (There was another post on this, but it did not help)

Thanks in advance,
Chris
0 Kudos
Message 1 of 2
(4,171 Views)
Hi Chris,

How do I set pins to be GPIO pins?
Once I've done that, how do I write to a specific pin?
Also, how do I make a pin trigger an interrupt?

A good reference for all of these questions is the BF button VIs. The BF Enable Button Interrupt VI contains a Call Library Function Node that calls lv_adi_ezEnableButtonCallback(), which is located in labview\Targets\ADI\Embedded\vdk\common\lv_device\device.c. The other button VIs also call functions that are implemented in this C file and others in that same directory. These C functions are wrappers for ADI System Services drivers, which you are likely familiar with from VisualDSP++.

On a side note, are there any good references/examples on how to use the LabView SPI vi's? (There was another post on this, but it did not help)
I am attaching some SPI example VIs that I hope you will find helpful.
--
Michael P
National Instruments
0 Kudos
Message 2 of 2
(4,165 Views)