Difference between revisions of "Tutorials/Getting Started/Getting Started with the VEX CORTEX"

From ROBOTC API Guide
Jump to: navigation, search
(Created page with "<yambe:breadcrumb>Tutorials|Tutorials</yambe:breadcrumb> <br /> == Getting Started with the VEX CORTEX == === Download Master Firmware === {|width="740px" |- |The Master Fir...")
 
(Step 4: Setting Cortex Communication Mode)
(31 intermediate revisions by 2 users not shown)
Line 1: Line 1:
<yambe:breadcrumb>Tutorials|Tutorials</yambe:breadcrumb>
+
{{DISPLAYTITLE:Getting Started with the VEX Cortex}}
 +
<yambe:breadcrumb self="Getting Started with the VEX Cortex">Tutorials|Tutorials</yambe:breadcrumb>
 
<br />
 
<br />
  
 +
{{toc}}
 +
<br />
  
== Getting Started with the VEX CORTEX ==
+
== Configuring the VEX Cortex for a WIRED connection using USB ==
=== Download Master Firmware ===
+
 
{|width="740px"
 
{|width="740px"
 
|-
 
|-
|The Master Firmware for the VEX 2.0 Cortex is sperate from the ROBOTC Firmware. The Master firmware controls all of the lower-level controls of the VEX 2.0 Cortex controller (such as VEXnet Communication). This firmware is supplied by Innovation FIRST and has not been modified by ROBOTC. Every VEX 2.0 Cortex Microcontroller is preloaded with a version of the master firmware, but downloading the latest version will ensure that your robot is compatible with the latest hardware available.
+
|This is a guide for setting up the VEX Cortex using the USB A-to-A cable. These steps are required the first time you use your computer to program a specific VEX Cortex, or after you've upated ROBOTC to the latest verstion. Once you've successfully completed these steps you can download your own programs without revisiting them. '''Note: Administrative privileges are required for some of these steps.'''
 +
|}
 +
<br />
  
'''To download and update the VEX 2.0 Cortex Master Firmware:'''
+
=== Note: Driver Installation ===
+
{|width="740px"
'''Place your VEX Cortex in "Bootload" Mode'''
+
|-
Placing your VEX Cortex in "Bootload" mode is necessary before downloading the Master CPU Firmware. Keep the Cortex powered OFF.
+
|ROBOTC 3.05 and later automatically installs the necessary drivers for the VEX Cortex, VEXnet Joysticks, and USB-to-Serial Programming cable. If you need to download the drivers for troubleshooting purposes, you can still find them at www.ROBOTC.net/download/cortex:<br />
Plug one end of the USB A-to-A Cable into a USB port on your computer. Do not plug the other end into the Cortex. Note: The order detailed in these steps is crucial. When the Cortex is powered on, it immediately tries to determine how it is connected (over VEXnet, USB, or no connection). Some power is provided to the Cortex over USB, which will allow it to determine that it is connected to your computer.<br />
+
{{vex2-drivers}}
[[File:01.png]]
+
|}
 +
<br />
  
 +
=== Step 1: Connect the Cortex to your PC ===
 +
{|width="740px"
 +
|-
 +
|Connect the VEX Cortex directly to a USB port on your computer using the USB A-to-A cable. Allow a few seconds for Windows to recognize the device.<br />
 +
[[File:vex2-getting-started-connect.JPG]]<br />
 +
<br />
 +
|-
 +
|Connect a 7.2V Robot battery to the Cortex and move the POWER switch to the ON position. Optionally, you can connect two motors to MOTOR Ports 2 and 3 for testing a sample program later in the sequence. You can connect 3-wire motors directly, or the newer 2-wire motors using Motor Controller 29 cables.<br />
 +
[[File:vex2-getting-started-battery_motors.JPG]]<br />
 +
''Note: Technically, the battery is not necessary for downloading Master CPU Firmware and ROBOTC Firmware, but it has helped in cases where the USB ports on the computer provide too little power to facilitate a reliable connection to the Cortex.''
 +
|}
 +
<br />
  
Use a paperclip or a 5/64 Allen Wrench to press and hold in the CONFIG button on the Cortex.<br />
+
=== Step 2: Platform Type and Communication Port ===
[[File:02.jpg]]
+
{|width="740px"
 +
|-
 +
|Specify that you are using the Cortex and how it is connected to your computer in ROBOTC. Go to Robot &rarr; Platform Type &rarr; Innovation First (IFI) and select "'''VEX 2.0 Cortex'''" or "'''Natural Language (VEX Cortex)'''".<br />
 +
[[File:vex2-getting-started-platform-selection.png]]<br />
 +
''Note: You should choose "'''VEX 2.0 Cortex'''" if you plan on programming using the standard ROBOTC language. Choose "'''Natural Language (VEX Cortex)'''" if you want to take advantage of the Natural Language commands in ROBOTC.''<br />
 +
<br />
 +
|-
 +
|Then go to View and choose Select Communication Port.<br />
 +
[[File:Comm port.png]]<br />
 +
<br />
 +
|-
 +
|The Select Communications Port for Platforms window will appear. From the Communications Port drop down list, you should see "Automatic Selection" and one of two additional options:
  
 +
If your VEX Cortex is in "bootload mode" or running an older (2.x) version of the Master CPU Firmware, it will appear as a "USB Wired Cable" option in the list.<br />
 +
[[File:Comm port select.png]]<br />
 +
<br />
 +
|-
 +
|If your VEX Cortex is running a newer (3.x) version of the Master CPU Firmware, it will appear as a "Vex Robotics Comm Port" in the list.<br />
 +
[[File:vex2-getting-started-auto-select.png]]<br />
 +
''Make sure that "Automatic Selection" or one of the two legitimate options is selected. If you ever plan on programming your robot wirelessly over VEXnet, choosing "Automatic Selection" is recommended. Press OK to save your choice.''
  
While pressing in the CONFIG button, connect the other end of the USB A-to-A cable to the USB port on the VEX Cortex. Keep the CONFIG button pressed in for an additional 5 seconds.<br />
 
[[File:03.jpg]]
 
 
 
Remove the Allen Wrench or paperclip, releasing the CONFIG button. After a few seconds, the ROBOT and GAME lights should blink green.<br />
 
[[File:04.jpg]]
 
 
 
Make sure a 7.2V Robot battery is connected and move the POWER switch on the Cortex to the ON position. Your setup should resemble the one in this picture, with the USB A-to-A cable connecting your computer and the VEX Cortex, and the 7.2 Volt Robot Battery powering the VEX Cortex. Note (Optional): You can connect two motors to MOTOR Ports 2 and 3 for testing a sample program later in the sequence. You can connect 3-wire motors directly, or the newer 2-wire motors using Motor Controller 29 cables.<br />
 
[[File:06.jpg]]
 
 
 
'''Platform Type and Communication Port'''<br />
 
Specify that you are using the Cortex and how it is connected to your computer in ROBOTC. Go to Robot > Platform Type > Innovation First (IFI) and select "VEX 2.0 Cortex" or "Natural Language (VEX Cortex)".<br />
 
[[File:platform.png]]
 
 
 
Then go to View and choose Select Communication Port.<br />
 
[[File:comm_port.png]]
 
 
 
A new window will appear. From the Communications Port dropdown list, make sure that "Automatic Selection" or the "USB Wired Cable" option are selected. If you plan on programming your robot wirelessly over VEXnet, keeping "Automatic Selection" chosen is recommended. Press OK to save your choice.<br />
 
[[File:comm_port_select.png]]
 
 
 
'''Downloading Master Firmware'''<br />
 
Go to Robot > Download Firmware > Master CPU Firmware and select "Standard File" to download the latest Master CPU Firmware to your robot.<br />
 
[[File:master.png]]
 
 
 
A Download Progress window will appear and begin the download process.<br />
 
[[File:download_master.png]]
 
 
 
When the window closes, the firmware download is complete. A ROBOTC Message will appear, and remind you to also download the ROBOTC Firmware.<br />
 
[[File:master_success.png]]
 
 
 
Note: You only need to download the Master CPU Firmware once, when you first start using a VEX Cortex with ROBOTC, or when you upgrade to a newer version of ROBOTC. Switching programs or download methods does not require a re-download.
 
 
   
 
   
Once the Master CPU Firmware finishes downloading, the Cortex will be recognized as a new device, and Windows may ask you to verify the software installation for the Cortex. Press Continue or Continue Anyway to complete the installation.<br />
 
[[File:new_hw.png]]
 
  
 
+
'''''Important:''' If the "USB Wired Cable" or "Vex Robotics Comm Port" options do not appear in the drop down menu when a VEX Cortex is connected, this may indicate that Windows has not recognized the device or access to it is blocked. Ensure that the VEX Cortex Device Driver was successfully installed with Administrative Privileges, disconnect and reconnect your Cortex from the computer, and press "Refresh List" to force ROBOTC to repopulate the list.''
Note: Once the device driver installation is complete, you should no longer need Administrative privileges on your computer; you should be able to download Master CPU Firmware, ROBOTC firmware, and ROBOTC programs in a permissions-restricted account. Only future updates to ROBOTC and theVEX Cortex Device Driver will require Administrative privileges.
+
 
|}
 
|}
 
<br />
 
<br />
  
 
+
=== Step 3: Updating VEX Cortex Firmware ===
=== Download ROBOTC Firmware ===
+
 
{|width="740px"
 
{|width="740px"
 
|-
 
|-
|The ROBOTC Firmware enables you to download ROBOTC programs to your robot and utilize the various debugger windows.
+
|Go to Robot &rarr; Download Firmware and select "Automatically Update VEX Cortex".<br />
 +
[[File:vex2-getting-started-auto-update.png]]<br />
 +
<br />
 +
|-
 +
|A message will appear, informing you that the software will update your Cortex to the latest Master CPU and ROBOTC Firmware files. Press OK to begin the process.<br />
 +
[[File:vex2-getting-started-robotc-message.png]]<br />
 +
<br />
 +
|-
 +
|A Download Progress window will appear, showing the progress of the Master CPU Firmware download.<br />
 +
[[File:vex2-getting-started-download-progress.png]]<br />
 +
<br />
 +
|-
 +
|When the Master CPU Firmware download is complete, a ROBOTC Message will appear and inform you that it will now update the ROBOTC firmware, if needed. Press OK to continue the process.<br />
 +
[[File:vex2-getting-started-ROBOTC_Message-2012-01-06_12_59_37.png]]<br />
 +
<br />
 +
|-
 +
|''Note: If this is the first time a VEX Cortex running the 3.x Master CPU Firmware has been connected to your computer, Windows will recognize it as a new device, and may prompt you to verify the new hardware installation. Press Continue or Continue Anyway to complete the installation.''<br />
 +
[[File:New hw.png]]<br />
 +
<br />
 +
|-
 +
|If your ROBOTC Firmware is out-of-date, another Download Progress window will appear and begin the ROBOTC Firmware download.<br />
 +
[[File:vex2-getting-started-Download_Progress-2012-01-06_13_00_34.png]]<br />
 +
<br />
 +
|-
 +
|When the download completes, another ROBOTC Message will appear. Press OK to complete the process.<br />
 +
[[File:vex2-getting-started-ROBOTC_Message-2012-01-06_13_00_00.png]]<br />
 +
<br />
 +
|-
 +
|'''''Notes:'''''
  
'''Prerequisites:'''
+
Once this step is complete, you should no longer need Administrative privileges on your computer; you should be able to download Master CPU Firmware, ROBOTC firmware, and ROBOTC programs in a permissions-restricted account. Only future updates to ROBOTC and the VEX Cortex Device Driver will require Administrative privileges. Exception: On some computers, Windows may prompt you to "install new hardware" each time the Cortex is plugged in on a different USB port. To alleviate the issue, connect the updated VEX Cortex on each USB port as an administrator (no need to redownload firmware), or dedicate one USB port for communication with the VEX Cortex.
*Connect the Cortex to your computer (over VEXnet or USB) and power it on
+
*Make sure VEX 2.0 Cortex is selected as the Platform Type
+
  
 +
'''You only need to download the Firmware once''', when you first start using a VEX Cortex with ROBOTC, or when you upgrade to a newer version of ROBOTC. You do not need to re-download the firmware every time you want to download code. If the download fails, disconnect the VEX Cortex from your computer and turn it off. Then reconnect it to the computer, allow a few seconds to ensure that Windows recognizes it, turn it on, and try downloading the firmware again.
 +
|}
 +
<br />
  
Go to Robot > Download Firmware > ROBOTC Firmware and select "Standard File" to download the ROBOTC Firmware to your robot.<br />
+
=== Step 4: Downloading and Running Code ===
[[File:tut-dl-robotc-fw-vex2.png]]
+
{|width="740px"
 +
|-
 +
|ROBOTC contains a large library of sample programs to help you get started. These sample programs can be downloaded to your VEX Cortex using the USB A-to-A cable, or using a wireless VEXnet connection.<br />
 +
<br />
 +
The VEX Cortex Communication Mode controls how ROBOTC downloads programs to your Cortex, as well as what types of connections your Cortex checks for when it is powered on. Confirm that your VEX Cortex Communication Mode is set to "VEXnet or USB" or "USB Only". "'''USB Only'''" is the recommended method for wired-only programming.<br />
 +
[[File:vex2-getting-started-usb-only.png]]<br />
 +
<br />
 +
'''Option 1: VEXnet or USB'''<br />
 +
With this option selected, ROBOTC will download programs to your Cortex using a VEXnet or USB connection. In this mode, when the Cortex is powered ON it will look for a VEXnet or USB connection for up to 15 seconds before running your program. (The Communication Port &rarr; Automatic Selection option in the ROBOTC Preferences should be selected if you plan on switching between VEXnet and USB as your download method.)<br />
  
 +
'''Option 2: USB Only'''<br />
 +
With this option selected, ROBOTC will download programs to your Cortex using only the USB connection. In this mode, when the Cortex is powered ON it will immediately run your program. This option will NOT work if you are using the VEXnet Joysticks to download to the Cortex, or remotely control it.<br />
  
A Download Progress window will appear and begin the download process. <br />
+
'''Option 3: Competition (VEXnet)'''<br />
[[File:robotc_download-vex2-tut.png]]
+
This option disables the ROBOTC debugger, and is not recommended for classroom use.<br />
 +
<br />
 +
|-
 +
|To open a sample program, go to File &rarr; Open Sample Program.<br />
 +
[[File:vex2-getting-started-program 2.png]]<br />
 +
<br />
 +
|-
 +
|Navigate to the Basic Movement folder and open "Moving Forward.c".<br />
 +
[[File:vex2-getting-started-program 1.png]]<br />
 +
<br />
 +
|-
 +
|Make sure that your robot is connected to the computer and turned ON. Then go to Robot &rarr; Compile and Download Program.<br />
 +
[[File:vex2-getting-started-compile.png]]<br />
 +
<br />
 +
|-
 +
|'''''Important Note:''''' The VEX Cortex Communication Mode is stored in ROBOTC and on the Cortex. If you change the setting, it gets transferred to the Cortex the next time you download a program. The Cortex must be power cycled (disconnected from the computer, turned fully off, and then back on) before the change will take effect.<br />
 +
[[File:vex2-getting-started-download_method_chage.png]]<br />
 +
<br />
 +
|-
 +
|Download Progress window will appear while the program is downloading to the Cortex.<br />
 +
[[File:Robotc download-vex2-tut.png]]<br />
 +
<br />
 +
|-
 +
|When the Download Progress window closes, the Program Debug window will appear. You can run your program by pressing the "Start" button, or by disconnecting the robot and turning it OFF and back ON.<br />
 +
[[File:vex2-getting-started-program_debug.png]]<br />
 +
<br />
 +
|-
 +
|With the sample program above, you should observe motors plugged into Ports 2 and 3 spinning for 3 seconds.<br />
 +
[[File:vex2-getting-started-battery_motors.JPG]]<br />
 +
<br />
 +
|}
 +
<br />
  
 +
=== Step 5: Getting More Help ===
 +
{|width="740px"
 +
|-
 +
|ROBOTC includes a useful Help system. You can launch the help system by going to the '''Help''' menu and selecting '''Open Help''', or by pressing the '''F1''' key on your keyboard.<br />
 +
[[File:vex2-getting-started-help.png]]<br />
 +
<br />
 +
|-
 +
|The [http://www.education.rec.ri.cmu.edu/products/teaching_robotc_cortex/index.html VEX Cortex Video Trainer] provides many useful video tutorials for learning the VEX Cortex system and ROBOTC Programming.
  
Once the Download Progress window closes, the ROBOTC Firmware download is complete. Your VEX Cortex is now ready to be programmed in ROBOTC over the USB A-to-A cable.<br />
 
[[File:robotc_success.png]]
 
  
 
+
Additional help and support can be found at http://www.robotc.net or by e-mailing support@robotc.net
Note: You only need to download the ROBOTC Firmware once, when you first start using a VEX Cortex with ROBOTC, or when you upgrade to a newer version of ROBOTC. You do not need to re-download the ROBOTC firmware every time you want to download code.
+
 
+
If you are also using the VEXnet Joysticks, you will need to update its firmware and establish a wireless VEXnet link between it and the Cortex.
+
 
|}
 
|}
 
<br />
 
<br />
  
=== Download VEXnet Joystick Firmware ===
+
== Configuring the VEX Cortex for a WIRELESS connection using the VEXnet Joysticks ==
 
{|width="740px"
 
{|width="740px"
 
|-
 
|-
|The VEXnet Joystick includes two joysticks (each having an X and Y-axis), 8 buttons on the front, and 4 additional trigger buttons on the top. Inside, there is also 3-Axis accelerometer, capable of providing X-Y-Z acceleration values. Values from the joysticks, buttons, and accelerometer are sent as a constant stream of information over VEXnet to the robot, enabling a user to control the robot in real-time.
+
|This is a guide for configuring the VEX Cortex system to be programmed wirelessly using a VEXnet connection. These steps are required the first time you use your computer to program a specific VEX Cortex, or after you've upated ROBOTC to the latest verstion. Once you've successfully completed these steps you can download your own programs without revisiting them. '''Note: Administrative privileges are required for some of these steps.'''
 
+
You will need to update the firmware on the VEXnet Joystick to ensure that it will operates correctly.
+
 
+
Placing your VEXnet Joystick in "Bootload" mode is necessary before downloading the VEXnet Joystick Firmware. Keep the VEXnet Joystick powered OFF.
+
The process of placing your VEXnet Joystick in Bootload mode is easier if you start by plugging one end of the USB A-to-A cable into the device. Keep the VEXnet Joystick turned OFF, and do not plug the other end of the USB A-to-A cable in yet.<br />
+
[[File:joy01.jpg]]
+
 
+
 
+
Use a paperclip to press and hold in the CONFIG button on the front of the VEXnet Joystick.<br />
+
[[File:joy02.JPG]]
+
 
+
 
+
Keeping the CONFIG button pressed in, connect the other end of the USB A-to-A cable to your computer.<br />
+
[[File:joy03.JPG]]
+
 
+
 
+
After a few seconds, release the CONFIG button. The ROBOT and GAME lights will blink green.<br />
+
[[File:joy04.JPG]]
+
 
+
 
+
Downloading VEXnet Joystick Firmware<br />
+
Go to Robot > Download Firmware > VEXnet Joystick Firmware and select "Standard File" to download the latest VEXnet Joystick Firmware to the controller.<br />
+
[[File:joystick.png]]
+
 
+
 
+
A Download Progress window will appear and begin the download process.<br />
+
[[File:download_master.png]]
+
 
+
 
+
When the window closes, the firmware download is complete.<br />
+
[[File:joysticksuccess.png]]
+
 
+
 
+
Note: You only need to download the VEXnet Joystick Firmware once, when you first start using it with ROBOTC, or when you upgrade to a newer version of ROBOTC.
+
 
|}
 
|}
 
<br />
 
<br />
  
=== Setting up VEXnet Communication ===
+
=== Note: Driver Installation ===
 
{|width="740px"
 
{|width="740px"
 
|-
 
|-
|In this section, you will learn how to pair a VEX Cortex Microcontroller to a VEXnet Remote Control, allowing them to communicate over VEXnet. This section assumes that you have already updated the master firmware on the VEX Cortex and VEXnet Remote Control. VEXnet is an 802.11 WiFi communication system between the VEX Cortex and VEXnet Remote Control.
+
|ROBOTC 3.05 and later automatically installs the necessary drivers for the VEX Cortex, VEXnet Joysticks, and USB-to-Serial Programming cable. If you need to download the drivers for troubleshooting purposes, you can still find them at www.ROBOTC.net/download/cortex:<br />
 
+
{{vex2-drivers}}
VEXnet features include:
+
*Easy to connect (No IP addresses, MAC addresses, passwords, or special security modes)
+
*Multiple layers of security built-in and always on
+
*No wireless access point needed; each VEXnet pair makes its own private network
+
*Hundreds of robots can operate at once; every VEXnet robot has a hidden unique ID
+
*Optional tether for wired communication
+
*Optional 9V battery backup to maintain wireless link during a main 7.2V power loss
+
*LED scheme displays the status of the Robot, VEXnet link, and Game (Competition Mode)
+
 
+
 
+
1. Begin by connecting both the Cortex and VEXnet Remote Control to charged batteries.
+
 
+
 
+
1a. Connect a 7.2V robot battery to the Cortex, but do not power it ON.<br />
+
[[File:SS-2010-10-13_17.05.00.png]]
+
 
+
 
+
1b. Remove the battery cover plate on the remote control. Install 6 AAA batteries, and replace the battery cover plate. Do not power the remote control ON.<br />
+
[[File:SS-2010-10-13_17.05.16.png]]
+
 
+
 
+
2. Tether the USB port on the VEXnet Remote Control to the USB port on the Cortex using a USB A-to-A cable.
+
 
+
 
+
2a. Plug one end of the USB A-to-A cable into the USB port on the VEXnet Remote Control.<br />
+
[[File:SS-2010-10-13_17.05.30.png]]
+
 
+
 
+
2b. Plug the other end of the USB A-to-A cable into the USB port on the VEX Cortex.<br />
+
[[File:SS-2010-10-13_17.05.48.png]]
+
 
+
 
+
3. Power the Cortex ON. After a few seconds, ROBOT and VEXnet LEDs will blink green, indicating that the Cortex and VEXnet Remote Control have successfully paired
+
 
+
 
+
3a. Turn the Cortex ON<br />
+
[[File:SS-2010-10-13_17.07.00.png]]
+
 
+
 
+
3b.The ROBOT and VEXnet LEDs will blink green once the Cortex and VEXnet Remote Control have successfully paired. The GAME LED will also blink green if a program is stored on your Cortex.<br />
+
[[File:DSCF8674.jpg]]
+
 
+
 
+
4. Turn the Cortex OFF.<br />
+
[[File:SS-2010-10-13_17.06.15.png]]
+
 
+
 
+
5. Remove the USB A-to-A cable from the VEXnet Remote Control and Cortex.<br />
+
[[File:SS-2010-10-13_17.06.42.png]]
+
 
+
 
+
6. Insert VEXnet USB Keys into both the VEXnet Remote Control and Cortex.<br />
+
[[File:DSCF8692.jpg]]
+
 
+
 
+
Note: It does not matter which VEXnet USB Key you insert into the Cortex versus the VEXnet Remote Control. Pairing the Cortex and VEXnet Remote Control establishes the link; the VEXnet USB Keys act as antennas for the link.
+
 
+
7. Power the Cortex and Remote Control ON. After roughly 15 seconds, the ROBOT and VEXnet LED’s will blink green, indicating that the VEXnet communication link has been established.
+
 
+
 
+
7a. Turn the Cortex ON<br />
+
[[File:SS-2010-10-13_17.07.00.png]]
+
 
+
 
+
7b. Turn the VEXnet Remote Control ON<br />
+
[[File:SS-2010-10-13_17.07.19.png]]
+
 
+
 
+
7c. After roughly 15 seconds, the ROBOT and VEXnet status LEDs will start blinking green. With the VEXnet link established, you should power OFF your Cortex and VEXnet Remote Control to preserve battery.<br />
+
[[File:SS-2010-10-13_17.07.33.png]]
+
 
+
 
+
Troubleshooting
+
 
+
'''Issue:''' Slow blinking green ROBOT light on the Cortex
+
'''Solution:''' Download the Cortex Master Firmware using ROBOTC.
+
 
+
'''Issue:''' Slow blinking ROBOT green light on the VEXnet Remote Control
+
'''Solution:''' Push and hold CONFIG button for about 5 seconds, until the status LEDs starts blinking green. Release it, wait for another 5 seconds, and then turn the VEXnet Remote Control OFF and then back ON. If that fails, download the VEXnet Joystick Firmware using ROBOTC.
+
 
+
'''Issue:''' Yellow or red ROBOT light on the Cortex
+
'''Solution:''' Make sure you are using fully charged Robot battery.
+
 
+
'''Issue:''' Yellow or red ROBOT light on the VEXnet Remote Control, even though they are both green on the Cortex.
+
'''Solution:''' Power cycle both the VEXnet Remote Control and CORTEX.
+
 
|}
 
|}
 
<br />
 
<br />
  
=== VEXnet Remote Control Calibration ===
+
=== Step 1: Connect the Cortex to your PC ===
 
{|width="740px"
 
{|width="740px"
 
|-
 
|-
|This document contains the procedure for calibrating the VEXnet Remote Control joysticks. <span style="color: red;">Some steps are time-sensitive, so it’s recommended that you read through the instructions once before following along.</span>
+
|Connect the VEX Cortex directly to a USB port on your computer using the USB A-to-A cable. Allow a few seconds for Windows to recognize the device.<br />
 
+
[[File:vex2-getting-started-connect.JPG]]<br />
The VEXnet Remote Control includes two joysticks (each having an X and Y-axis), 8 buttons on the front, and 4 additional trigger buttons on the top. Inside, there is also 3-Axis accelerometer, capable of providing X-Y-Z acceleration values. Values from the joysticks, buttons, and accelerometer are sent as a constant stream of information over VEXnet to the robot, enabling a user to control the robot in real-time. To ensure that the VEXnet Remote Control sends out accurate joystick values, the joysticks must be calibrated before their first use, and after any firmware updates are applied to the remote control.
+
<br />
 
+
|-
You will need:
+
|Connect a 7.2V Robot battery to the Cortex and move the POWER switch to the ON position. Optionally, you can connect two motors to MOTOR Ports 2 and 3 for testing a sample program later in the sequence. You can connect 3-wire motors directly, or the newer 2-wire motors using Motor Controller 29 cables.<br />
*A VEXnet Remote Control with batteries
+
[[File:vex2-getting-started-battery_motors.JPG]]<br />
*A VEX Cortex with robot battery
+
''Note: Technically, the battery is not necessary for downloading Master CPU Firmware and ROBOTC Firmware, but it has helped in cases where the USB ports on the computer provide too little power to facilitate a reliable connection to the Cortex.''
*A small Allen wrench (1/16” or smaller) or paper clip
+
 
+
 
+
1. Power on the VEXnet Remote Control and VEX Cortex. Allow them to sync over VEXnet.<br />
+
[[File:SS-2010-10-13_15.10.44.png]]
+
 
+
 
+
2. Press and hold the 6U trigger button.<br />
+
[[File:SS-2010-10-13_15.12.05.png]]
+
 
+
 
+
3. While keeping the 6U trigger button pressed in, use your Allen wrench or paper clip to press in the internal CONFIG button until the JOYSTICK LED blinks red and green.
+
 
+
 
+
3a. While still pressing in the 6U trigger button, use an Allen wrench or paper clip to press in the CONFIG button.<br />
+
[[File:SS-2010-10-13_15.12.19.png]]
+
 
+
 
+
3b. Once the JOYSTICK LED begins to blink red and green, release both the 6U and CONFIG buttons.<br />
+
[[File:SS-2010-10-13_15.12.33.png]]
+
 
+
 
+
 
+
<span style="color: red;">Important - Time Sensitive Instructions<br />There is a 10 second time limit to complete steps 4 and 5. If they are not completed in time, the calibration process will timeout and the VEXnet LED will blink red briefly.</span>
+
 
+
4. Move both joysticks through their full ranges of motion. When the remote control detects that the joysticks have been fully rotated, the JOYSTICK LED stops blinking red and green, and switches to a solid green.
+
 
+
4a. Move the joysticks through their full ranges of motion - Up, Down, Left, Right, and in a circle.<br />
+
[[File:SS-2010-10-13_15.12.49.png]]
+
 
+
 
+
4b. Once the remote control detects that the joysticks have been fully rotated, the JOYSTICK LED switches to solid green, indicating that you can stop moving the joysticks.<br />
+
[[File:SS-2010-10-13_15.13.09.png]]
+
 
+
 
+
5. Press the 8U button to save the joystick calibration on your remote control. The JOYSTICK LED will blink green for a few seconds.<br />
+
[[File:SS-2010-10-13_15.13.27.png]]
+
 
+
 
+
Additional Information
+
*If the calibration is not saved, the process will timeout after 10 seconds and the VEXnet LED will blink red.
+
*To cancel a calibration, press the 7U button. The calibration process will be discontinued and the VEXnet LED will blink red.
+
*Once the calibration is discontinued or saved, all of the remote control LEDs will resume their normal function.
+
*The joysticks must be calibrated any time the firmware on the remote control is downloaded.
+
 
|}
 
|}
 
<br />
 
<br />
  
=== Sample Programs ===
+
=== Step 2: Platform Type and Communication Port ===
 
{|width="740px"
 
{|width="740px"
 
|-
 
|-
|One of the best ways to start working with ROBOTC and learning how to program is to look at already developed programs. ROBOTC comes with over 75 sample programs to help the programmer learn how to program their robotics controllers.
+
|Specify that you are using the Cortex and how it is connected to your computer in ROBOTC. Go to Robot &rarr; Platform Type &rarr; Innovation First (IFI) and select "'''VEX 2.0 Cortex'''" or "'''Natural Language (VEX Cortex)'''".<br />
 +
[[File:vex2-getting-started-platform-selection.png]]<br />
 +
''Note: You should choose "'''VEX 2.0 Cortex'''" if you plan on programming using the standard ROBOTC language. Choose "'''Natural Language (VEX Cortex)'''" if you want to take advantage of the Natural Language commands in ROBOTC.''<br />
 +
<br />
 +
|-
 +
|Then go to View and choose Select Communication Port.<br />
 +
[[File:Comm port.png]]<br />
 +
<br />
 +
|-
 +
|The Select Communications Port for Platforms window will appear. From the Communications Port drop down list, you should see "Automatic Selection" and one of two additional options:
  
To access these sample programs, open the "Sample Programs" folder by going to the "File" menu and selecting "Open Sample Program."<br />
+
If your VEX Cortex is in "bootload mode" or running an older (2.x) version of the Master CPU Firmware, it will appear as a "USB Wired Cable" option in the list.<br />
[[File:sampleprograms_menu.png]]
+
[[File:Comm port select.png]]<br />
 +
<br />
 +
|-
 +
|If your VEX Cortex is running a newer (3.x) version of the Master CPU Firmware, it will appear as a "Vex Robotics Comm Port" in the list.<br />
 +
[[File:vex2-getting-started-auto-select.png]]<br />
 +
''Make sure that "Automatic Selection" or one of the two legitimate options is selected. If you ever plan on programming your robot wirelessly over VEXnet, choosing "Automatic Selection" is recommended. Press OK to save your choice.''
  
 +
  
Inside of the sample programs folder, there are a number of samples organized by topic. ROBOTC will automatically open the sample programs folder of the platform you currently have selected.<br />
+
'''''Important:''' If the "USB Wired Cable" or "Vex Robotics Comm Port" options do not appear in the drop down menu when a VEX Cortex is connected, this may indicate that Windows has not recognized the device or access to it is blocked. Ensure that the VEX Cortex Device Driver was successfully installed with Administrative Privileges, disconnect and reconnect your Cortex from the computer, and press "Refresh List" to force ROBOTC to repopulate the list.''
[[File:sampleprogram_files.png]]
+
 
+
 
+
Just double click on one of the sample programs to open it up and learn more about ROBOTC programming.<br />
+
 
|}
 
|}
 
<br />
 
<br />
  
=== Compiling and Downloading ===
+
=== Step 3: Updating VEX Cortex Firmware ===
 
{|width="740px"
 
{|width="740px"
 
|-
 
|-
|ROBOTC is considered to be an "Integrated Development Environment." This means that ROBOTC has a custom text editor for developing code that will assist the programmer by color coding different potions of code to differentiate between integers, reserved words, functions and parameters.<br />
+
|Go to Robot &rarr; Download Firmware and select "Automatically Update VEX Cortex".<br />
[[File:SS-2010-10-14_11.33.22.png]]
+
[[File:vex2-getting-started-auto-update.png]]<br />
 +
<br />
 +
|-
 +
|A message will appear, informing you that the software will update your Cortex to the latest Master CPU and ROBOTC Firmware files. Press OK to begin the process.<br />
 +
[[File:vex2-getting-started-robotc-message.png]]<br />
 +
<br />
 +
|-
 +
|A Download Progress window will appear, showing the progress of the Master CPU Firmware download.<br />
 +
[[File:vex2-getting-started-download-progress.png]]<br />
 +
<br />
 +
|-
 +
|When the Master CPU Firmware download is complete, a ROBOTC Message will appear and inform you that it will now update the ROBOTC firmware, if needed. Press OK to continue the process.<br />
 +
[[File:vex2-getting-started-ROBOTC_Message-2012-01-06_12_59_37.png]]<br />
 +
<br />
 +
|-
 +
|''Note: If this is the first time a VEX Cortex running the 3.x Master CPU Firmware has been connected to your computer, Windows will recognize it as a new device, and may prompt you to verify the new hardware installation. Press Continue or Continue Anyway to complete the installation.''<br />
 +
[[File:New hw.png]]<br />
 +
<br />
 +
|-
 +
|If your ROBOTC Firmware is out-of-date, another Download Progress window will appear and begin the ROBOTC Firmware download.<br />
 +
[[File:vex2-getting-started-Download_Progress-2012-01-06_13_00_34.png]]<br />
 +
<br />
 +
|-
 +
|When the download completes, another ROBOTC Message will appear. Press OK to complete the process.<br />
 +
[[File:vex2-getting-started-ROBOTC_Message-2012-01-06_13_00_00.png]]<br />
 +
<br />
 +
|}
  
 +
=== Step 4: Setting Cortex Communication Mode ===
 +
{|width="740px"
 +
|-
 +
|Open up a program you would like to load onto the Cortex. For the purposes of this tutorial, we selected the 'Dual Joystick Control' program from the 'Remote Control' Sample Programs folder.<br /><br />
 +
[[File:Cortex VEXNet Sample Prog.png]]<br /><br />
 +
|-
 +
|With the Cortex turned on and plugged in, navigate to 'VEX Cortex Communication Mode' under the 'Robot' menu. Select 'VEXNet or USB' as the communication type.<br /><br />
 +
[[File:Cortex Communication Type.png]] <br /><br />
 +
|-
 +
|Compile and download the program to the Cortex. ROBOTC will pop up a message telling you that the communication mode has been changed and that a power cycle is required in order for the changes to take affect. <br /><br />
 +
[[File:Cortex Communication Powercycle.png]]<br /><br />
 +
|-
 +
|Once the program has downloaded to the Cortex, turn the Cortex off and back on. This 'power cycle' commits the communication type to the Cortex. Remember, you must repeat this process to revert back to USB only (making sure that USB only is selected as the mode). The Cortex should now be set up for wireless communication over VEXNet.<br /><br />
 +
|}
  
ROBOTC also contains a compiler for turning this user generated code in a byte-code language that the different controller platforms can understand. To run the compiler, access the compile function from the "Robot" menu.<br />
+
'''''Note:'''''
[[File:SS-2010-10-14_11.33.57.png]]
+
  
 +
Once these steps are complete, you should no longer need Administrative privileges on your computer; you should be able to download Master CPU Firmware, ROBOTC firmware, and ROBOTC programs in a permissions-restricted account. Only future updates to ROBOTC and the VEX Cortex Device Driver will require Administrative privileges. Exception: On some computers, Windows may prompt you to "install new hardware" each time the Cortex is plugged in on a different USB port. To alleviate the issue, connect the updated VEX Cortex on each USB port as an administrator (no need to redownload firmware), or dedicate one USB port for communication with the VEX Cortex.
  
When the compiler runs, ROBOTC will check your program for errors and warnings that would cause your program to not run properly on the robot. Rather than send this broken code to your robot, ROBOTC will inform you of these errors so they can be corrected.
+
'''You only need to download the Firmware''' when you first start using a VEX Cortex with ROBOTC, or when you upgrade to a newer version of ROBOTC. You do not need to re-download the firmware every time you want to download code. If the download fails, disconnect the VEX Cortex from your computer and turn it off. Then reconnect it to the computer, allow a few seconds to ensure that Windows recognizes it, turn it on, and try downloading the firmware again.
 
+
In the example below:
+
*The reserved word 'motor' was incorrectly typed as 'Motor', generating a warning. A warning tells the user that they've created an error, but ROBOTC is able to correct this error itself when the program is sent to the controller. A program with warning will compile successfully, but users should use good programming practice to avoid warnings. Warnings are denoted by a yellow "X".
+
*The code on line 5 is missing a semicolon, which is generating an error. An error will prevent the program from being sent to the controller. ROBOTC will do its best to explain what the error to assist the user. In this example, ROBOTC is informing the user they left a semicolon off a line of their program which is preventing the program from being compiled. Errors are denoted by a red "X".<br />
+
[[Image:SS-2010-10-14_11.34.58.png]]
+
 
+
 
+
Before downloading code to your robot, you should verify that the "VEX Cortex Download Method" matches your setup.<br />
+
[[Image:SS-2010-10-14_11.35.39.png]]
+
 
+
 
+
'''Option 1: Download Using VEXnet or USB'''<br />
+
With this option selected, ROBOTC will download ROBOTC firmware and programs to your Cortex using a VEXnet or USB connection. In this mode, when the Cortex is powered ON it will look for a VEXnet or USB connection before running your program. (The Communication Port > Automatic Selection option in the ROBOTC Preferences should be selected if you plan on switching between VEXnet and USB as your download method.)
+
 
+
'''Option 2: Download Using USB Only'''<br />
+
With this option selected, ROBOTC will download firmware and programs to your Cortex using only the USB connection. In this mode, when the Cortex is powered ON it will immediately run your program. This option is NOT recommended if you are using the VEXnet Joysticks to download to the Cortex, or remotely control it.
+
 
+
'''Option 3: Download for Competition (VEXnet)'''<br />
+
This option disables the ROBOTC debugger, and is not recommended for classroom use.
+
 
+
''Note: Switching between Download Modes may require you to power cycle your Cortex before it takes effect.''
+
 
+
Once your program has successfully compiled and you've selected the appropriate Download Method, you can send the program to the controller by clicking the "Compile and Download Program" option under the "Robot" menu. Note:  Your robot must be turned on and connected to the computer before you can download a program.<br />
+
[[Image:SS-2010-10-14_11.36.04.png]]
+
 
+
 
+
Once the download starts, a "Download Progress" bar will appear. This bar will show the status of the transfer of the compiled byte-code to the controller.<br />
+
[[File:SS-2010-10-13_14.05.46.png]]
+
 
+
 
+
Once the download finishes, ROBOTC's built in debugger will be launched. There will be a number of windows that launch, such as the Global Variables window, the Devices window and the Program Debug window. You can start your programs execution by clicking the "Start" button on the "Program Debug" window. Learn more about these windows in the 'Debugger' section of the help file.<br />
+
[[File:compiler.png]]
+
|}
+
 
<br />
 
<br />

Revision as of 18:08, 27 September 2012

Tutorials → Getting Started with the VEX Cortex




Configuring the VEX Cortex for a WIRED connection using USB

This is a guide for setting up the VEX Cortex using the USB A-to-A cable. These steps are required the first time you use your computer to program a specific VEX Cortex, or after you've upated ROBOTC to the latest verstion. Once you've successfully completed these steps you can download your own programs without revisiting them. Note: Administrative privileges are required for some of these steps.


Note: Driver Installation

ROBOTC 3.05 and later automatically installs the necessary drivers for the VEX Cortex, VEXnet Joysticks, and USB-to-Serial Programming cable. If you need to download the drivers for troubleshooting purposes, you can still find them at www.ROBOTC.net/download/cortex:
The drivers for the CORTEX Microcontroller and VEXnet Joysticks are included in the ROBOTC 3.0 installers. If, for any reason, you need to download them separately, here are the downloads:
Download Network Driver (in addition to required driver) if ROBOTC will run from a network:


Step 1: Connect the Cortex to your PC

Connect the VEX Cortex directly to a USB port on your computer using the USB A-to-A cable. Allow a few seconds for Windows to recognize the device.

Vex2-getting-started-connect.JPG

Connect a 7.2V Robot battery to the Cortex and move the POWER switch to the ON position. Optionally, you can connect two motors to MOTOR Ports 2 and 3 for testing a sample program later in the sequence. You can connect 3-wire motors directly, or the newer 2-wire motors using Motor Controller 29 cables.

Vex2-getting-started-battery motors.JPG
Note: Technically, the battery is not necessary for downloading Master CPU Firmware and ROBOTC Firmware, but it has helped in cases where the USB ports on the computer provide too little power to facilitate a reliable connection to the Cortex.


Step 2: Platform Type and Communication Port

Specify that you are using the Cortex and how it is connected to your computer in ROBOTC. Go to Robot → Platform Type → Innovation First (IFI) and select "VEX 2.0 Cortex" or "Natural Language (VEX Cortex)".

Vex2-getting-started-platform-selection.png
Note: You should choose "VEX 2.0 Cortex" if you plan on programming using the standard ROBOTC language. Choose "Natural Language (VEX Cortex)" if you want to take advantage of the Natural Language commands in ROBOTC.

Then go to View and choose Select Communication Port.

Comm port.png

The Select Communications Port for Platforms window will appear. From the Communications Port drop down list, you should see "Automatic Selection" and one of two additional options:

If your VEX Cortex is in "bootload mode" or running an older (2.x) version of the Master CPU Firmware, it will appear as a "USB Wired Cable" option in the list.
Comm port select.png

If your VEX Cortex is running a newer (3.x) version of the Master CPU Firmware, it will appear as a "Vex Robotics Comm Port" in the list.

Vex2-getting-started-auto-select.png
Make sure that "Automatic Selection" or one of the two legitimate options is selected. If you ever plan on programming your robot wirelessly over VEXnet, choosing "Automatic Selection" is recommended. Press OK to save your choice.


Important: If the "USB Wired Cable" or "Vex Robotics Comm Port" options do not appear in the drop down menu when a VEX Cortex is connected, this may indicate that Windows has not recognized the device or access to it is blocked. Ensure that the VEX Cortex Device Driver was successfully installed with Administrative Privileges, disconnect and reconnect your Cortex from the computer, and press "Refresh List" to force ROBOTC to repopulate the list.


Step 3: Updating VEX Cortex Firmware

Go to Robot → Download Firmware and select "Automatically Update VEX Cortex".

Vex2-getting-started-auto-update.png

A message will appear, informing you that the software will update your Cortex to the latest Master CPU and ROBOTC Firmware files. Press OK to begin the process.

Vex2-getting-started-robotc-message.png

A Download Progress window will appear, showing the progress of the Master CPU Firmware download.

Vex2-getting-started-download-progress.png

When the Master CPU Firmware download is complete, a ROBOTC Message will appear and inform you that it will now update the ROBOTC firmware, if needed. Press OK to continue the process.

Vex2-getting-started-ROBOTC Message-2012-01-06 12 59 37.png

Note: If this is the first time a VEX Cortex running the 3.x Master CPU Firmware has been connected to your computer, Windows will recognize it as a new device, and may prompt you to verify the new hardware installation. Press Continue or Continue Anyway to complete the installation.

New hw.png

If your ROBOTC Firmware is out-of-date, another Download Progress window will appear and begin the ROBOTC Firmware download.

Vex2-getting-started-Download Progress-2012-01-06 13 00 34.png

When the download completes, another ROBOTC Message will appear. Press OK to complete the process.

Vex2-getting-started-ROBOTC Message-2012-01-06 13 00 00.png

Notes:

Once this step is complete, you should no longer need Administrative privileges on your computer; you should be able to download Master CPU Firmware, ROBOTC firmware, and ROBOTC programs in a permissions-restricted account. Only future updates to ROBOTC and the VEX Cortex Device Driver will require Administrative privileges. Exception: On some computers, Windows may prompt you to "install new hardware" each time the Cortex is plugged in on a different USB port. To alleviate the issue, connect the updated VEX Cortex on each USB port as an administrator (no need to redownload firmware), or dedicate one USB port for communication with the VEX Cortex.

You only need to download the Firmware once, when you first start using a VEX Cortex with ROBOTC, or when you upgrade to a newer version of ROBOTC. You do not need to re-download the firmware every time you want to download code. If the download fails, disconnect the VEX Cortex from your computer and turn it off. Then reconnect it to the computer, allow a few seconds to ensure that Windows recognizes it, turn it on, and try downloading the firmware again.


Step 4: Downloading and Running Code

ROBOTC contains a large library of sample programs to help you get started. These sample programs can be downloaded to your VEX Cortex using the USB A-to-A cable, or using a wireless VEXnet connection.


The VEX Cortex Communication Mode controls how ROBOTC downloads programs to your Cortex, as well as what types of connections your Cortex checks for when it is powered on. Confirm that your VEX Cortex Communication Mode is set to "VEXnet or USB" or "USB Only". "USB Only" is the recommended method for wired-only programming.
Vex2-getting-started-usb-only.png

Option 1: VEXnet or USB
With this option selected, ROBOTC will download programs to your Cortex using a VEXnet or USB connection. In this mode, when the Cortex is powered ON it will look for a VEXnet or USB connection for up to 15 seconds before running your program. (The Communication Port → Automatic Selection option in the ROBOTC Preferences should be selected if you plan on switching between VEXnet and USB as your download method.)

Option 2: USB Only
With this option selected, ROBOTC will download programs to your Cortex using only the USB connection. In this mode, when the Cortex is powered ON it will immediately run your program. This option will NOT work if you are using the VEXnet Joysticks to download to the Cortex, or remotely control it.

Option 3: Competition (VEXnet)
This option disables the ROBOTC debugger, and is not recommended for classroom use.

To open a sample program, go to File → Open Sample Program.

Vex2-getting-started-program 2.png

Navigate to the Basic Movement folder and open "Moving Forward.c".

Vex2-getting-started-program 1.png

Make sure that your robot is connected to the computer and turned ON. Then go to Robot → Compile and Download Program.

Vex2-getting-started-compile.png

Important Note: The VEX Cortex Communication Mode is stored in ROBOTC and on the Cortex. If you change the setting, it gets transferred to the Cortex the next time you download a program. The Cortex must be power cycled (disconnected from the computer, turned fully off, and then back on) before the change will take effect.

Vex2-getting-started-download method chage.png

Download Progress window will appear while the program is downloading to the Cortex.

Robotc download-vex2-tut.png

When the Download Progress window closes, the Program Debug window will appear. You can run your program by pressing the "Start" button, or by disconnecting the robot and turning it OFF and back ON.

Vex2-getting-started-program debug.png

With the sample program above, you should observe motors plugged into Ports 2 and 3 spinning for 3 seconds.

Vex2-getting-started-battery motors.JPG


Step 5: Getting More Help

ROBOTC includes a useful Help system. You can launch the help system by going to the Help menu and selecting Open Help, or by pressing the F1 key on your keyboard.

Vex2-getting-started-help.png

The VEX Cortex Video Trainer provides many useful video tutorials for learning the VEX Cortex system and ROBOTC Programming.


Additional help and support can be found at http://www.robotc.net or by e-mailing support@robotc.net


Configuring the VEX Cortex for a WIRELESS connection using the VEXnet Joysticks

This is a guide for configuring the VEX Cortex system to be programmed wirelessly using a VEXnet connection. These steps are required the first time you use your computer to program a specific VEX Cortex, or after you've upated ROBOTC to the latest verstion. Once you've successfully completed these steps you can download your own programs without revisiting them. Note: Administrative privileges are required for some of these steps.


Note: Driver Installation

ROBOTC 3.05 and later automatically installs the necessary drivers for the VEX Cortex, VEXnet Joysticks, and USB-to-Serial Programming cable. If you need to download the drivers for troubleshooting purposes, you can still find them at www.ROBOTC.net/download/cortex:
The drivers for the CORTEX Microcontroller and VEXnet Joysticks are included in the ROBOTC 3.0 installers. If, for any reason, you need to download them separately, here are the downloads:
Download Network Driver (in addition to required driver) if ROBOTC will run from a network:


Step 1: Connect the Cortex to your PC

Connect the VEX Cortex directly to a USB port on your computer using the USB A-to-A cable. Allow a few seconds for Windows to recognize the device.

Vex2-getting-started-connect.JPG

Connect a 7.2V Robot battery to the Cortex and move the POWER switch to the ON position. Optionally, you can connect two motors to MOTOR Ports 2 and 3 for testing a sample program later in the sequence. You can connect 3-wire motors directly, or the newer 2-wire motors using Motor Controller 29 cables.

Vex2-getting-started-battery motors.JPG
Note: Technically, the battery is not necessary for downloading Master CPU Firmware and ROBOTC Firmware, but it has helped in cases where the USB ports on the computer provide too little power to facilitate a reliable connection to the Cortex.


Step 2: Platform Type and Communication Port

Specify that you are using the Cortex and how it is connected to your computer in ROBOTC. Go to Robot → Platform Type → Innovation First (IFI) and select "VEX 2.0 Cortex" or "Natural Language (VEX Cortex)".

Vex2-getting-started-platform-selection.png
Note: You should choose "VEX 2.0 Cortex" if you plan on programming using the standard ROBOTC language. Choose "Natural Language (VEX Cortex)" if you want to take advantage of the Natural Language commands in ROBOTC.

Then go to View and choose Select Communication Port.

Comm port.png

The Select Communications Port for Platforms window will appear. From the Communications Port drop down list, you should see "Automatic Selection" and one of two additional options:

If your VEX Cortex is in "bootload mode" or running an older (2.x) version of the Master CPU Firmware, it will appear as a "USB Wired Cable" option in the list.
Comm port select.png

If your VEX Cortex is running a newer (3.x) version of the Master CPU Firmware, it will appear as a "Vex Robotics Comm Port" in the list.

Vex2-getting-started-auto-select.png
Make sure that "Automatic Selection" or one of the two legitimate options is selected. If you ever plan on programming your robot wirelessly over VEXnet, choosing "Automatic Selection" is recommended. Press OK to save your choice.


Important: If the "USB Wired Cable" or "Vex Robotics Comm Port" options do not appear in the drop down menu when a VEX Cortex is connected, this may indicate that Windows has not recognized the device or access to it is blocked. Ensure that the VEX Cortex Device Driver was successfully installed with Administrative Privileges, disconnect and reconnect your Cortex from the computer, and press "Refresh List" to force ROBOTC to repopulate the list.


Step 3: Updating VEX Cortex Firmware

Go to Robot → Download Firmware and select "Automatically Update VEX Cortex".

Vex2-getting-started-auto-update.png

A message will appear, informing you that the software will update your Cortex to the latest Master CPU and ROBOTC Firmware files. Press OK to begin the process.

Vex2-getting-started-robotc-message.png

A Download Progress window will appear, showing the progress of the Master CPU Firmware download.

Vex2-getting-started-download-progress.png

When the Master CPU Firmware download is complete, a ROBOTC Message will appear and inform you that it will now update the ROBOTC firmware, if needed. Press OK to continue the process.

Vex2-getting-started-ROBOTC Message-2012-01-06 12 59 37.png

Note: If this is the first time a VEX Cortex running the 3.x Master CPU Firmware has been connected to your computer, Windows will recognize it as a new device, and may prompt you to verify the new hardware installation. Press Continue or Continue Anyway to complete the installation.

New hw.png

If your ROBOTC Firmware is out-of-date, another Download Progress window will appear and begin the ROBOTC Firmware download.

Vex2-getting-started-Download Progress-2012-01-06 13 00 34.png

When the download completes, another ROBOTC Message will appear. Press OK to complete the process.

Vex2-getting-started-ROBOTC Message-2012-01-06 13 00 00.png

Step 4: Setting Cortex Communication Mode

Open up a program you would like to load onto the Cortex. For the purposes of this tutorial, we selected the 'Dual Joystick Control' program from the 'Remote Control' Sample Programs folder.

Cortex VEXNet Sample Prog.png

With the Cortex turned on and plugged in, navigate to 'VEX Cortex Communication Mode' under the 'Robot' menu. Select 'VEXNet or USB' as the communication type.

Cortex Communication Type.png

Compile and download the program to the Cortex. ROBOTC will pop up a message telling you that the communication mode has been changed and that a power cycle is required in order for the changes to take affect.

Cortex Communication Powercycle.png

Once the program has downloaded to the Cortex, turn the Cortex off and back on. This 'power cycle' commits the communication type to the Cortex. Remember, you must repeat this process to revert back to USB only (making sure that USB only is selected as the mode). The Cortex should now be set up for wireless communication over VEXNet.

Note:

Once these steps are complete, you should no longer need Administrative privileges on your computer; you should be able to download Master CPU Firmware, ROBOTC firmware, and ROBOTC programs in a permissions-restricted account. Only future updates to ROBOTC and the VEX Cortex Device Driver will require Administrative privileges. Exception: On some computers, Windows may prompt you to "install new hardware" each time the Cortex is plugged in on a different USB port. To alleviate the issue, connect the updated VEX Cortex on each USB port as an administrator (no need to redownload firmware), or dedicate one USB port for communication with the VEX Cortex.

You only need to download the Firmware when you first start using a VEX Cortex with ROBOTC, or when you upgrade to a newer version of ROBOTC. You do not need to re-download the firmware every time you want to download code. If the download fails, disconnect the VEX Cortex from your computer and turn it off. Then reconnect it to the computer, allow a few seconds to ensure that Windows recognizes it, turn it on, and try downloading the firmware again.