using the vex cortex with · pdf filefollow the steps below to ensure your ... , you will need...
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