Recent Changes - Search:

Main

Robotics I Fall 2007

Robotics II Spring 2007

Robotics I Fall 2006

Vision Servoing Laboratories

FPGA-Based Vision

VDSP

LabVIEW Embedded

Code

Site Admin

edit SideBar

EZ-KITLiteTutorial

Here is a tutorial for getting started using NI's LabVIEW Embedded Module with ADI's ADSP-BF537 EZ-KIT Lite®. The demo walks you through creating a new LabVIEW Embedded project and getting it to run on the BF537 EZ-KIT Lite. In the demo, you'll attach one of the EZ-KIT Lite's pushbuttons to one of its LEDs, so that when you press the button, the LED lights up. Let's get started.

Plug the EZ-KIT Lite into the emulator. Make sure the EZ-KIT Lite has power, and connect it to the development PC through the emulator. Note: do NOT launch Visual DSP++®.

Launch LabVIEW Embedded Edition and select the Blackfin 537 as your target. In the main LabVIEW Embedded screen, at the bottom, you must select Analog Devices ADSP-BF537, VDK Module as your target:

Create a new, blank VI. VI stands for Virtual Instrument, which is a LabVIEW program. Create a new, blank VI by clicking on the drop-down arrow in the New button and selecting Blank VI:

Create a While Loop in the VI's Block Diagram. The VI consists of a Block Diagram, where the LabVIEW code goes, and a Front Panel, which is used for interaction. In this tutorial, we'll only be working with the Block Diagram.

We're going to start off by drawing a While Loop in the Block Diagram.

Find the Block Diagram window. Right-click anywhere in the window. This brings up the Functions palette. Drill down to the Structures palette, and grab the While Loop object. It's the 2nd from the left of the top row, highlighted by a thin blue box:

Draw the While Loop across the Block Diagram. With the mouse down, drag to draw the While Loop:

Get the 'Is Button Pushed' control. Next we will drop the EZ-KIT Lite's Is Button Pushed? control into our VI. Drill down starting at the Blackfin controls icon (start by right-clicking), into EZ-KIT Lite, Button, and get the BF Is Button Pushed control:

Drop the control into the VI. The Block Diagram window should now look like this:

Highlight the 'button number' input. Position the mouse over the blue input circle -- the upper left corner of the control -- and the input should display its name, button number:

Create a Constant as the button number input. Just where you are, right-click to get the contextual menu, and select Create:Constant:

Edit the button number constant. We'll build the demo so that it uses button 1, so edit the constant's value accordingly:

Get the LED On/Off Control. Right-click on the Block Diagram background, and dive into the Blackfin tools, getting the 'BF LED On Off' control:

Drop the control into the VI. The Block Diagram should now look like this:

Create a Constant as the LED number input. Right-click on the LED number input, select 'Create:Constant', and edit its value so that you will control LED1:

Attempt to wire button output to LED input. What you would like to do is wire the button output to the LED input. But you can't, because the data formats will not match.

Instead, insert a datatype conversion block. Right-click and dive to the Boolean palette. Retrieve the Boolean to (0,1) block:

Place it in the block diagram. It will look like this:

Wire the boolean converter between the button output and LED input. Connect the Is Button Pushed output to the converter input, and then the converter output to the LED On Off input. It will look like below.

Notice the green dotted wire, between the button output and the converter. This indicates a boolean signal. The blue wire, between the converter and the LED input, indicates an integer signal.

Establish the While Loop Termination as False. We are almost done building the Block Diagram. Next, we need to wire a False to the While Loop's Stop sign. This means 'never stop' or 'always run.' Do this by right-clicking on the Stop sign, and selecting Create Constant:

The While Loop termination installed. By the way, why is the While loop is necessary at all? It's needed so that the LabVIEW program will repeatedly copy the button state to the LED state. Otherwise, the program would just run once and stop.

The While Loop termination looks like this. Notice that False is highlighted, meaning, 'don't stop'.

The program is ready to run. Now, click on the Run Arrow, near the upper left of the window:

Save the VI and create a new Embedded Project. The software will prompt for a file name for saving the VI. Give button-led as the filename. It will save with a .vi extension.

Next, you will be presented with a dialog for associating the VI with an Embedded Project. Click on New:

New Project dialog. Here is the New Project dialog. The project's name is also button-led:

Project Manager dialog. Next, the project manager dialog will appear. Notice that the project has a '.lep' extension. This stands for LabVIEW Embedded Project. From this window, select the menu Target, and then choose Build Options...:

Configure Build Options. This is the Build Options dialog. Select the Debug mode as Non-instrumented (via JTAG/EZ-KIT USB):

Set up Target Configuration. Back at the Project Manager dialog, menu-select Target:Configure Target.... From this window, choose the options as shown below:

Run the program. Get the program started by selecting Target:Debug. Note: you could also choose Target:Run, but then Front Panel interaction (which we haven't done yet) would not work, so you may as well get in the habit of running in Debug mode:

Create embedded application. One last step! Tell the software: yes, go ahead and build the embedded application:

It should now just work! The software will now crank for a while. It has to compile, link, download and then finally run your project. When it starts it running, it will display the Front Panel, which is presently blank. This means your embedded application is running.

Try it! Press Button 1 on the EZ-KIT Lite. LED1 should light up. Does it work? Congratulations! You have built your first LabVIEW Embedded for Blackfin project.

Next steps. Subsequent tutorials will demonstrate how to get real-time interaction with Front Panel buttons, sliders and displays, which update live as your embedded application is executing.

Edit - History - Print - Recent Changes - Search
Page last modified on March 30, 2006, at 05:48 PM