using the vex cortex with · pdf filefollow the steps below to ensure your ... , you will need...

14
ROBOTC Using the VEX Cortex with ROBOTC 1 © 2010 Carnegie Mellon Robotics Academy / For use with VEX Robotics Systems Using the VEX Cortex with ROBOTC 1. Download the latest VEXnet Firmware Upgrade Utility from ROBOTC.net. Use the utility and included instructions to update the firmware on your Cortex and VEXnet Remote Control. You will need: 1 VEX Cortex Microcontroller with one 7.2V Robot Battery 2 Motor Modules connected to MOTOR ports 2 and 3 on the VEX Cortex 1 VEXnet Remote Control with 6 AAA Batteries 2 VEXnet USB Adapter Keys A computer with ROBOTC for Cortex 2.3 BETA or higher installed 1 VEX Programming Kit 1 USB A-to-A Cable This document is a guide for downloading and running programs on the VEX Cortex using ROBOTC for Cortex 2.3 BETA. It is broken into four sections: Prerequisites, Downloading Using USB Only, Downloading Using VEXnet or USB, and Troubleshooting. Prerequisites Both the Cortex and your computer require some configuration before you are able to program your robot using ROBOTC. Follow the steps below to ensure your system is ready. 1a. Navigate to ROBOTC.net Visit http://www.robotc.net/ download/cortex/ 1b. Download and Run the Utility Download the “VEXnet Firmware Upgrade Utility” file. Use the utility to update the firmware on your Cortex and VEXnet Remote Control. VEX Cortex Setup

Upload: ngodung

Post on 31-Jan-2018

237 views

Category:

Documents


0 download

TRANSCRIPT

ROBOTC

Using the VEX Cortex with ROBOTC • 1© 2010 Carnegie Mellon Robotics Academy / For use with VEX Robotics Systems

Using the VEX Cortex with ROBOTC

1.DownloadthelatestVEXnet Firmware Upgrade UtilityfromROBOTC.net.UsetheutilityandincludedinstructionstoupdatethefirmwareonyourCortexandVEXnetRemoteControl.

Youwillneed:• 1VEXCortexMicrocontrollerwithone7.2VRobotBattery• 2MotorModulesconnectedtoMOTORports2and3ontheVEXCortex• 1VEXnetRemoteControlwith6AAABatteries• 2VEXnetUSBAdapterKeys• AcomputerwithROBOTCforCortex2.3BETAorhigherinstalled• 1VEXProgrammingKit• 1USBA-to-ACable

This document is a guide for downloading and running programs on the VEX Cortex using ROBOTC for Cortex 2.3 BETA. It is broken into four sections: Prerequisites, Downloading Using USB Only, Downloading Using VEXnet or USB, and Troubleshooting.

PrerequisitesBoththeCortexandyourcomputerrequiresomeconfigurationbeforeyouareabletoprogramyourrobotusingROBOTC.Followthestepsbelowtoensureyoursystemisready.

1a. NavigatetoROBOTC.netVisithttp://www.robotc.net/download/cortex/

1b. DownloadandRuntheUtilityDownloadthe“VEXnetFirmwareUpgradeUtility”file.UsetheutilitytoupdatethefirmwareonyourCortexandVEXnetRemoteControl.

VEX Cortex Setup

ROBOTC

Using the VEX Cortex with ROBOTC • 2© 2010 Carnegie Mellon Robotics Academy / For use with VEX Robotics Systems

Using the VEX Cortex with ROBOTC (cont.)

2.DownloadandinstalltheappropriatedevicedriverfortheUSB-to-Serialadapter(VEXProgrammingKit)foryoursystem.

2a. NavigatetoROBOTC.netVisithttp://www.robotc.net/download/cortex/

2b. DownloadandInstallthedriverDownloadandinstallthecorrectdriverfortheoperatingsystemonyourcomputer.

3. SetthePlatform TypeinROBOTCtoVEX 2.0 Cortex.

VEX Cortex Setup

ROBOTC

Using the VEX Cortex with ROBOTC • 3© 2010 Carnegie Mellon Robotics Academy / For use with VEX Robotics Systems

1. LeavingthePOWERswitchintheOFFposition,connectyourCortextothecomputerusingtheUSBA-to-Acable.Oncethecableisattached,movethePOWERswitchtotheONposition.

Using the VEX Cortex with ROBOTC (cont.)

Option 1. Downloading Using USB OnlyWhenprogrammingtheVEXCortex,aUSBA-to-AcablecanbeusedtodirectlyconnectyourcomputertotheCortex.Thismethodinstructstherobottoimmediatelyruntheprogramstoredinmemorywhenitispoweredon,andskipstheintialVEXnetlinksetup.DownloadingusingUSBonlyiseffectiveforwritingandtestingautonomous-onlyprogramsthatdonorequireaVEXnetlink.

2. SpecifyhowyourCortexisconnectedtothecomputerintheROBOTCPreferences.

1a. ConnecttheCortextoyourPCUsetheUSBA-to-AcabletoconnectyourCortextoyourPC.

1b. TurntheCortexONMakesurea7.2VRobotbatteryisconnectedandmovethePOWERswitchontheCortextoON.

2a. DetailedPreferences...GotoView>PreferencesandselectDetailed Preferences...

VEX Cortex Setup

ROBOTC

Using the VEX Cortex with ROBOTC • 4© 2010 Carnegie Mellon Robotics Academy / For use with VEX Robotics Systems

Using the VEX Cortex with ROBOTC (cont.)

3. TheROBOTCFirmwareenablesyoutodownloadROBOTCprogramstoyourrobotandutilizethevariousdebugwindows.GotoRobot>Download FirmwareandselectDownload using Default FiletodownloadtheROBOTCFirmwaretoyourrobot.

2c. CommunicationPortToprogramdirectlyovertheUSBA-to-Acable,selecttheoptionthatspecifystheUSB Wired Cable. PressOKtofinalizeyoursetting.

2b. PlatformTab MakesurethatthePlatform

tabisselectedontheROBOTC Preferences window.

3.DownloadProgressADownload Progresswindowwillappearandbeginthedownloadprocess.Whenthewindowcloses,thefirmwaredownloadiscomplete.Note:YouonlyneedtodownloadtheROBOTCFirmwareonce.Switchingprogramsordownloadmethodsdoesnotrequireare-download.

VEX Cortex Setup

ROBOTC

Using the VEX Cortex with ROBOTC • 5© 2010 Carnegie Mellon Robotics Academy / For use with VEX Robotics Systems

Using the VEX Cortex with ROBOTC (cont.)

4.GotoFileandselectOpen Sample ProgramtoopenaROBOTCsampleprogram.

4.OpenaSampleProgramWhentheOpendialogueboxappears,opentheBasic MovementfolderandselectMoving Forward.c.

5. SpecifytheDownload Using USB OnlyastheVEX Cortex Download Method.ROBOTCwillrememberyourchoice,soyoudonotneedtoselectiteverytimeyoudownloadaprogram.

VEX Cortex Setup

ROBOTC

Using the VEX Cortex with ROBOTC • 6© 2010 Carnegie Mellon Robotics Academy / For use with VEX Robotics Systems

Using the VEX Cortex with ROBOTC (cont.)

6.GotoRobotandselectCompile and Download Programtodownloadthesampleprogramtotherobot.

6.DownloadProgressADownload Progresswindowwillappearandbeginthedownloadprocess.Whenthewindowcloses,theprogramdownloadiscomplete.

InadditiontoROBOTC,theVEXCortexalsoremembersyourDownloadMethodsetting.Ifthisisthefirsttimethatyouhavechosen“Download Using USB Only”,orifyoujustswitchedfrom“Download Using VEXnet USB”or“Download for Competition (VEXnet)”,youwillneedtocompletelypowercycleyourCortex(unplugtheUSBcable,powertheCortexOFFandthenON)beforetheupdatedsettingtakeseffectandtheprogramrunsimmediately.

TheprocessofpowercyclingyourCortexisrequiredanytimeyouswitchtheDownloadMethodsetting.

Important Information - Power Cycle the VEX Cortex

7. RuntheprogramonyourrobotbypressingtheStartbuttonontheProgramDebugwindow,orbypowercyclingtheCortex.

7a. ProgramDebugwindow TheProgram Debug windowappearsevery

timeyoudownloadaROBOTCprogramtoyourrobot.PresstheStartbuttontoruntheprogram.

Note:RememberthatyoumayneedtopowercycleyourCortexfortheprogramtoimmediatelyrun,ifyouareusingDownload Using USB Onlythefirsttime,orhavejustswitchedfromanothermethod.

VEX Cortex Setup

ROBOTC

Using the VEX Cortex with ROBOTC • 7© 2010 Carnegie Mellon Robotics Academy / For use with VEX Robotics Systems

Using the VEX Cortex with ROBOTC (cont.)

7b. PowerCycletheCortex Youcanalsoruntheprogrambyturningthe

CortexOFF,andthenON.

Note:TheUSBcableprovidessomepowertotheCortex,soitmustbeunpluggedtofullyturntheCortexOFF.ClosingtheROBOTCProgramDebugwindowbeforeunpluggingtheUSBcableisrecommended.

8.Observethesampleprogramrunningontherobot.ThemotorspluggedintoMOTORports2and3shouldspinfor3seconds,accordingtotheROBOTCprogram.

End of Section: Option 1. Downloading Using USB Only Inthissection,youlearnedhowtoprogramyourrobotdirectlyovertheUSBA-to-Acable.Ifyouexperiencedissueswiththeprocess,makesureyou’vefollwedeverystep,andthenreferencethetroubleshootingsectionbelow.

VEX Cortex Setup

ROBOTC

Using the VEX Cortex with ROBOTC • 8© 2010 Carnegie Mellon Robotics Academy / For use with VEX Robotics Systems

1.UsetheVEXProgrammingKittoconnectaUSBportonyourcomputertothePROGRAMportonyourVEXnetRemoteControl.TurnboththeCortexandVEXnetRemoteControlONandallowthemtosync.

Option 2. Downloading Using VEXnet or USBWhenusingtheVEXnetlinktocommunicatebetweenyourcomputerandtheCortex,downloadingfirmware,downloadingprograms,andusingtheROBOTCreal-timedebuggerallworkwirelessly.ThisguideassumesyouhavealreadyconfiguredtheVEXnetlinkbetweenyourCortexandVEXnetRemoteControl.ProgramsdownloadedusingthismethodwillnotrununtilaVEXnetlinkhasbeenestablishedoruntil10secondshaveelapsedsincetheCortexwaspoweredon.

Using the VEX Cortex with ROBOTC (cont.)

2. SpecifyhowyourCortexisconnectedtothecomputerintheROBOTCPreferences.

2a. DetailedPreferences...GotoView>PreferencesandselectDetailed Preferences...

VEX Cortex Setup

ROBOTC

Using the VEX Cortex with ROBOTC • 9© 2010 Carnegie Mellon Robotics Academy / For use with VEX Robotics Systems

Using the VEX Cortex with ROBOTC (cont.)

2c. CommunicationPortROBOTCusestheconnectionbetweenyourcomputerandtheVEXnetRemoteControltotakeadvantageoftheVEXnetcommunicationlink.TheVEXnetRemoteControlactsasanintermediarybetweenROBOTCandyourrobot.SelecttheportthatspecifystheProlific USB-to-Serial Comm Portand pressOKtofinalizeyoursetting.

2b. PlatformTab MakesurethatthePlatform

tabisselectedontheROBOTC Preferences window.

3. TheROBOTCFirmwareenablesyoutodownloadROBOTCprogramstoyourrobotandutilizethevariousdebugwindows.GotoRobot>Download FirmwareandselectDownload using Default FiletodownloadtheROBOTCFirmwaretoyourrobot.

3.DownloadProgressADownload Progresswindowwillappearandbeginthedownloadprocess.Whenthewindowcloses,thefirmwaredownloadiscomplete.Note:YouonlyneedtodownloadtheROBOTCFirmwareonce.Switchingprogramsordownloadmethodsdoesnotrequireare-download.

VEX Cortex Setup

ROBOTC

Using the VEX Cortex with ROBOTC • 10© 2010 Carnegie Mellon Robotics Academy / For use with VEX Robotics Systems

Using the VEX Cortex with ROBOTC (cont.)

4.GotoFileandselectOpen Sample ProgramtoopenaROBOTCSampleProgram.

4.OpenaSampleProgramWhentheOpendialogueboxappears,opentheBasic MovementfolderandselectMoving Forward.c.

5. SpecifytheDownload Using VEXnet or USBastheVEX Cortex Download Method.ROBOTCwillrememberyourchoice,soyoudonotneedtoselectiteverytimeyoudownloadaprogram.

VEX Cortex Setup

ROBOTC

Using the VEX Cortex with ROBOTC • 11© 2010 Carnegie Mellon Robotics Academy / For use with VEX Robotics Systems

Using the VEX Cortex with ROBOTC (cont.)

6.GotoRobotandselectCompile and Download Programtodownloadthesampleprogramtotherobot.

6.DownloadProgressADownload Progresswindowwillappearandbeginthedownloadprocess.Whenthewindowcloses,theprogramdownloadiscomplete.

InadditiontoROBOTC,theVEXCortexalsoremembersyourDownloadMethodsetting.Ifthisisthefirsttimethatyouhavechosen“Download Using VEXnet or USB”,orifyoujustswitchedfrom“Download Using USB only”or“Download for Competition (VEXnet)”,youwillneedtocompletelypowercycleyourCortex(powertheCortexOFFandthenON)beforetheupdatedsettingtakeseffectandtheprogramlooksfortheVEXnetlinkbeforerunning.

TheprocessofpowercyclingyourCortexisrequiredanytimeyouswitchtheDownloadMethodsetting.

Important Information - Power Cycle the VEX Cortex

7. RuntheprogramonyourrobotbypressingtheStartbuttonontheProgramDebugwindow,orbypowercyclingtheCortex.

7a. ProgramDebugwindow TheProgram Debug windowappearsevery

timeyoudownloadaROBOTCprogramtoyourrobot.PresstheStartbuttontoruntheprogram.

Note:RememberthatyoumayneedtopowercycleyourCortexfortheprogramtoestablishaVEXnetlinkbeforerunning,ifyouareusingDownload Using VEXnet or USB thefirsttime,orhavejustswitchedfromanothermethod.

VEX Cortex Setup

ROBOTC

Using the VEX Cortex with ROBOTC • 12© 2010 Carnegie Mellon Robotics Academy / For use with VEX Robotics Systems

Using the VEX Cortex with ROBOTC (cont.)Using the VEX Cortex with ROBOTC (cont.)

7b. PowerCycletheCortex Youcanalsoruntheprogrambyturningthe

CortexOFF,andthenON.

Note:TheCortexwillnotruntheprogramuntilaVEXnetlinkhasbeenestablishedoratleast10secondshaveelapsed.ClosingtheROBOTCProgramDebugwindowbeforeturningofftheCortexisrecommended.

8.Observethesampleprogramrunningontherobot.ThemotorspluggedintoMOTORports2and3shouldspinfor3seconds,accordingtotheROBOTCprogram.

End of Section: Option2 . Downloading Using VEXnet or USB Inthissection,youlearnedhowtoprogramyourrobotwirelesslyusingVEXnet.Ifyouexperiencedissueswiththeprocess,makesureyou’vefollwedeverystep,andthenreferencethetroubleshootingsectionbelow.

VEX Cortex Setup

ROBOTC

Using the VEX Cortex with ROBOTC • 13© 2010 Carnegie Mellon Robotics Academy / For use with VEX Robotics Systems

Using the VEX Cortex with ROBOTC (cont.)

Troubleshooting Problem: CommunicationusingtheUSBA-to-AcablebetweenROBOTCandtheCortexisveryslow,ornotworking.

Resolution:Verifyeachofthefollowingoptions,andre-testyourcommunicationlinkbeforemovingon:

IstheUSBA-to-AcableconnectingthecomputertoyourCortex?TheUSBcablewillprovidesomepowertotheCortex,poweringsomeofitsstatuslights.Ifnot,tryrebootingyoursystem.

Isyourrobotalsoconnectedtoandpoweredonbyachargedbattery?

DidyouhavetherobotpoweredonbeforeyouconnectedittothecomputerusingtheUSBA-to-Acable?TherobotmustfirstbeconnectedtothecomputerusingtheUSBA-to-Acable,andthenpoweredonwiththebattery.

IsVEX2.0CortexselectedasthePlatformTypeinROBOTC?

HaveyouselectedthecorrectCommunicationPortintheROBOTCPreferences?

HaveyoudownloadedtheROBOTCFirmwaretotheCortex?

VEX Cortex Setup

ROBOTC

Using the VEX Cortex with ROBOTC • 14© 2010 Carnegie Mellon Robotics Academy / For use with VEX Robotics Systems

Using the VEX Cortex with ROBOTC (cont.)Using the VEX Cortex with ROBOTC (cont.)

Troubleshooting Ifyou’veverifiedallofthepreviousoptionswithnosuccess,youcanenable“MessageTracing”toputROBOTCintoapersistentcommunicationmode.

BeginbygoingtoWindow>Menu LevelandselectingSuper UsertoswitchyourviewingpreferencestotheSuperUserlevel.

ThengotoView>PreferencesandselectDetailed Preferences...

OntheInternaltab,selectMessagesunderMessage TracingtoputROBOTCintoitspersistentcommunicationmode.PressOKtoverifyyoursetting.

Nowwhenyoudownloadaprogram,ROBOTCwillalsoopentheMessage LogwiththeCortexinanewtab.YoucanswitchbackandforthbetweenyourprogramandtheMessageLogbyclickingonthedesiredtab.

VEX Cortex Setup