LogoLogo
  • Welcome!
  • Mission Statement
  • Contributing Guidelines
    • Embed CADs in Wiki Articles
  • VEX Worlds Livestream Archive
    • VEX U
    • V5RC High School
    • V5RC Middle School
    • VIQRC Middle School
    • VIQRC Elementary School
    • JROTC
  • ⚙️Hardware
    • Design Fundamentals
      • Gear Ratios
      • Internal Forces (Stress)
      • Torque
      • RPM
      • Center of Mass
    • Introduction to VEX Parts
      • Structure
        • C-Channels and Angles
        • Fasteners
        • Retainers
        • Gussets and Brackets
        • Bearings
        • Plate Metal and Flat Bars
      • Motion
        • High Strength Components
        • Gears and Sprockets
        • Traction Wheels
        • Mecanum Wheels
        • Omnidirectional Wheels
        • Flex Wheels
    • Robot Decorations
      • Part Dyeing
      • Metal Coloring
      • License Plate Holders
    • Lifts
      • Double Reverse Four Bar (DR4B or RD4B)
      • Four Bar
      • Scissor Lift
      • Six Bar
      • Other Lifts
      • Best Practices
    • Shooting Mechanisms
      • Catapult
      • Flywheel
      • Linear Puncher
    • Drivetrains
      • Tank Drive
      • Mecanum Drive
      • Holonomic Drive
      • Designing a Drivetrain
      • Best Practices
    • Pivots & Joints
    • Pneumatics
      • Best Practices - Pneumatics
    • Intakes
    • Flip Out Mechanisms
    • Defensive Mechanisms
    • Misc. Building Techniques
    • VexU
      • Common Manufacturing Techniques
        • 3D Printing
        • Laser Cutting
      • Custom Manufactured Parts Library
      • Commercial Off The Shelf Parts Library
  • 👑Team Administration
    • New Team Resources
      • Creating The Team
      • Gaining Interest for Robotics Teams
      • Attending Competitions
        • Elimination Bracket
    • Team Dynamics
      • Organization Structure and Longevity
      • Member Allocation and Management
      • How *Not* To Run a Team
    • Team Finances
      • One-Year Team Financial Breakdown
      • Funding Your Teams
    • Hosting Competitions
      • Live Streaming
      • Tournament Manager
        • Competition Electronics
        • Creating a Tournament
        • Tools
          • Field Set Control
          • Connecting Mobile Devices
          • Connecting Raspberry Pis
        • Match Control
          • Inputting Match Scores
          • Inputting Skills Scores
          • Inputting Scores on TM Mobile
        • Displays
        • Alliance Selection
      • Additional Event Partner Resources
    • VexU Organization Management
      • Getting Started in VexU
      • Team / Personnel Management
      • Volunteering At Local Events
  • 📚The Judging Process
    • The Engineering Design Process
      • Test and Refine
    • The Engineering Notebook
      • Segments of the Notebook
      • BLRS2 '23-'24 Engineering Notebook
      • Integrating Inventor Models into Documentation
      • Engineering Notebook Rubric Breakdown
    • The Interview
      • Interview Rubric Breakdown
    • Using Notion for an Engineering Notebook
      • How to Setup a Notebook
      • How to Create Entries
      • How to Export a Notebook
      • Purdue SIGBots Notion Template
        • Game Analysis
        • Identify The Problem
        • Brainstorm Solution
        • Select Best Approach & Plan
        • Build Log
        • Programming Log
        • Testing Solution
        • Tournament Recap
        • Innovative Feature
  • 🖥️VEX CAD
    • CAD Programs
      • Inventor
      • Fusion 360
      • Solidworks
      • OnShape
      • Protobot
    • Making a Chassis
      • Inventor Chassis: The Basics
        • Installation
        • User Interface Overview
        • Dark Mode
        • Assemblies
        • Placing Parts
        • Navigating CAD
        • Changing Visual Style
        • Grounding
        • Connecting Two C-Channels
        • Modifying Existing Constraints
        • Toggling Visibility on Existing Parts
        • Completing Half of the Chassis
          • Inner Drive Channel
          • Bearing Flats
          • Motors
          • Wheels
          • Sprockets
          • Spacers, Washers and Standoffs
          • Spacers Cont.
        • Creating Mid-Plane
        • Mirroring
      • Inventor Chassis: Best Practices
        • File Structure
        • Subassemblies
        • Wheel Subassembly
        • Origin Planes
        • Cross Brace
        • Drive Channels
        • Simple Motor iMates
        • Replacing Simple Electronics
        • Completing Half of the Drive
          • Bearing Flats (Best Practice)
          • Wheels
          • Powered Gear
          • Spacer Boxing
          • Spacers, Washers and Standoffs (Best Practice)
        • Model Browser Folders
        • Mirroring (Best Practice)
        • Model Browser Folder (Right)
        • Main Assembly
      • Fusion 360 Chassis
      • Solidworks Chassis, Chain, and Custom Plastic
    • Remembering The Best
      • 62A Skyrise
      • 400X Nothing But Net
      • 2587Z Nothing But Net
      • 365X Starstruck
      • 62A In The Zone
      • 202Z In The Zone
      • 5225A In The Zone
      • 169A Turning Point
      • 929U Turning Point
      • 7K Tower Takeover
      • 5225A Tower Takeover
      • 62A Change Up
    • Scuff Controller
  • 💻Software
    • Odometry
    • Path Planning
    • Robotics Basics
      • Arcade Drive
      • Tank Drive
      • Joystick Deadzones
      • Curvature (Cheesy) Drive
      • Subsystem Toggling
    • Organizing Code
      • Code Style
      • Code Styling Guide
      • Writing Good Comments
      • Version Control
    • Control Algorithms
      • Bang Bang
      • PID Controller
      • Basic Pure Pursuit
      • Flywheel Velocity Control
      • Kalman Filter
      • Take Back Half (TBH) Controller
      • RAMSETE Controller
    • Competition Specific
      • Operator Control
      • Autonomous Control
    • C++ Basics for VEX Robotics
      • Basic Control Flow
      • Enumerations
      • Namespaces (::)
      • Multiple Files (C/C++)
    • VEX Programming Software
      • PROS
        • OkapiLib
      • vexide
      • Robot Mesh Studio (RMS)
      • EasyC
      • RobotC
      • VEXcode
      • Midnight C
    • General
      • Stall Detection
      • Register Programming
      • Sensors and Odometry in Autonomous
      • Embedded Programming Tips
      • Debugging
      • Bit Shift
      • Bit Mask
      • Autoformatting
      • Finite State Machine
      • Data Logging
    • Object Recognition
      • Red Green Buoy
      • AMS
      • OpenCV
      • OpenNI
    • 🤖AI in VRC: Pac-Man Pete
  • ⚡VEX Electronics
    • V5 ESD Protection Board
    • VEX Electronics
      • VEX V5 Brain
        • V5 Electronics Observations and Issues
      • VEX Controller
      • VEXnet and V5 Robot Radio
      • VEX Battery
      • VEX Motors
    • VEX Sensors
      • 3-Pin / ADI Sensors
        • Encoder
        • Potentiometer
        • Limit Switch
        • Bumper Switch
        • Accelerometer
        • Gyroscope
        • Ultrasonic
        • Line Tracker
        • LED Indicator
      • Smart Port Sensors
        • GPS Sensor
        • Rotation Sensor
        • Vision Sensor
        • Optical Sensor
        • Distance Sensor
        • Inertial Sensor (IMU)
        • 3-Wire Expander
    • V5 Brain Wiring Guide
    • Legacy
      • VEX Cortex
      • Power Expander
      • VEX Motor Controller
      • VEX Cortex Wiring Guide
  • General Electronics
    • General Topics
      • External Boards
        • ASUS Tinker Board S
        • Arduino
        • Beagleboard
        • Leaflabs Maple
        • LattePanda
        • Meadow F7 Micro
        • Netduino
        • ODROID-XU4
        • Pandaboard
        • Raspberry Pi
      • Analog-Digital Converter (ADC)
      • Bit-Bang
      • GPIO
      • I2C
      • Jitter
      • Line Noise
      • List of Tools
      • Output Drive
      • Power Consumption
      • Radius Array
      • Resettable Fuse (PTC)
      • SPI
      • Slew Rate
      • Stalling
      • USART
      • UART
      • 5 Volt Tolerant
      • DC Motor Basics
Powered by GitBook
LogoLogo

This work is licensed under a Attribution-ShareAlike 2.0 Generic License

On this page
  • Features
  • Shortcomings
  • Usage
  • Troubleshooting
  • Known issues
  • Download Firmware
  • External pinout
  • Advanced
  • GPIO Pin Mapping
  • SPI
  • I2C
  • Other peripherals
  • External port details

Was this helpful?

Edit on GitHub
Export as PDF
  1. VEX Electronics
  2. Legacy

VEX Cortex

The VEX Cortex is the older microcontroller that was used in VRC and VEXU

PreviousLegacyNextPower Expander

Last updated 3 years ago

Was this helpful?

This article is about the VEX Cortex, which is the legacy microcontroller for VRC and is no longer competitive

The VEX Cortex is the older microcontroller legal for use in VRC. It is a 32-bit ARM Cortex-M3 processor with support for , , and . It features ten motor outputs which can deliver up to 8 A combined of current (12 A with a ), twelve digital inputs/outputs, eight analog inputs, and three communication interfaces.

Features

  • Well-shielded against environmental hazards

  • Input pins carry short-circuit and ESD protection

  • Compatible with the standard line of and

  • Only microcontroller which is allowed to directly interface with actuators on the robot

  • High-speed, 32-bit ARM Cortex-M3 platform

  • Wireless communication and code download using

  • Programmable in PROS, EasyC, or RobotC

  • Digital and analog pins are 5-volt tolerant

  • Code debugging ( only)

Shortcomings

  • RobotC interprets the user program, a substantial speed hit to the running program. EasyC and PROS do not have these issues

  • VEXnet communications can be lag-prone or inconsistent

  • is higher than it could be

  • Large, yet does not break out all pins of the microcontroller core chip

  • Most powerful chip peripherals are unavailable

Usage

The VEX Cortex may be mounted in almost any orientation on the robot using 8/32" bolts. However, it is most convenient to have the ports facing upward and the power switch easily accessible. A USB extension cable should be used to relocate the VEXNet key away from potential sources of interference.

Since the VEX Cortex is the only microcontroller which can run actuators on the robot, all past robots have had one. As of VEX Gateway, the additional functionality of Midnight C (PROS) and more peripherals have been unlocked. PROS has been used to program the VEX Cortex since VEX Sack Attack.

Troubleshooting

Robot

VEXNet

Game

Diagnosis

Red

See below

Robot battery is dead

Red (fast flash)

See below

Backup battery low or unplugged

Red (slow flash)

See below

User code has crashed

Yellow

See below

Robot battery is low

Green (slow flash)

Off

Green (flickering)

Ready to download firmware If not intended, restart the Cortex

:::

Red (slow flash)

:::

Downloading firmware

Green

:::

Off

VEXNet communications lost

:::

Yellow (slow flash)

:::

VEXNet initializing

Green or Green (+1 blink)

Green

:::

Tethered to PC or joystick

:::

Green (fast flash)

:::

User code running (no competition switch)

:::

:::

Green

Driver control

:::

:::

Yellow

Robot disabled, set competition switch to Enable

Green (fast flash)

:::

Green (fast flash)

Autonomous mode

Off

Green (slow flash)

Off

Code download in progress If stuck in this state, restart the Cortex

Known issues

Download Firmware

If VEX releases a firmware update, or the Cortex is acting in an erratic manner, it is time to reflash the firmware. A valid copy of RobotC is required to reflash the RobotC Firmware; EasyC and Midnight C only requires a Mastercode update, which can be done without EasyC using the VEXnet Firmware Upgrade Utility.

  • Turn off the Cortex

  • Connect an orange USB A to A cable to the Cortex USB port and the PC

  • Use the appropriate Firmware Update command to reflash the new firmware:

    • RobotC: Use ''Robot > Download Firmware > ROBOTC Firmware > Standard File''

    • EasyC: Open the ''VEXnet Firmware Upgrade Utility'', select ''Bootload'', answer "Yes" to ''Start Boot Loader?'', and when prompted, click ''Upgrade''

    • PROS: Use ''VEX > Update Mastercode...'' (Windows only), select ''Bootload'', answer "Yes" to ''Start Boot Loader?'', and when prompted, click ''Upgrade''

  • When complete, unplug and restart the Cortex

External pinout

The VEX Cortex external pin layout

Advanced

GPIO Pin Mapping

Inside of a VEX Cortex microcontroller

Ditto, bottom view

  • Digital 1 - PE9 (TIM1_CH1/FSMC_D6)

  • Digital 2 - PE11 (TIM1_CH2/FSMC_D8)

  • Digital 3 - PC6 (TIM3_CH1/I2S2_MCK/TIM8_CH1/SDIO_D6)

  • Digital 4 - PC7 (TIM3_CH2/I2S3_MCK/TIM8_CH2/SDIO_D7)

  • Digital 5 - PE13 (TIM1_CH3/FSMC_D10)

  • Digital 6 - PE14 (TIM1_CH4/FSMC_D11)

  • Digital 7 - PE8 (TIM1_CH1N/FSMC_D5)

  • Digital 8 - PE10 (TIM1_CH2N/FSMC_D7)

  • Digital 9 - PE12 (TIM1_CH3N/FSMC_D9)

  • Digital 10 - PE7 (TIM1_ETR/FSMC_D4)

  • Digital 11 - PD0 (CAN_RX/FSMC_D2/OSC_IN)

  • Digital 12 - PD1 (CAN_TX/FSMC_D3/OSC_OUT)

  • SP - PA4 (USART2_CK/DAC_OUT1/ADC_4)

  • Analog 1 - PA0 (WKUP/USART2_CTS/TIM2_CH1_ETR/TIM5_CH1/TIM8_ETR/ADC_0)

  • Analog 2 - PA1 (USART2_RTS/TIM5_CH2/TIM2_CH2/ADC_1)

  • Analog 3 - PA2 (USART2_TX/TIM5_CH3/TIM2_CH3/ADC_2)

  • Analog 4 - PA3 (USART2_RX/TIM5_CH4/TIM2_CH4/ADC_3)

  • Analog 5 - PC2 (ADC_12)

  • Analog 6 - PC3 (ADC_13)

  • Analog 7 - PC0 (ADC_10)

  • Analog 8 - PC1 (ADC_11)

  • UART1_TX - PD5 (FSMC_NWE/USART2_TX)

  • UART1_RX - PD6 (FSMC_NWAIT/USART2_RX)

  • UART2_TX - PC10 (UART4_TX/SDIO_D2/USART3_TX)

  • UART2_RX - PC11 (UART4_RX/SDIO_D3/USART3_RX)

  • I2C1_SCL - PB8 (TIM4_CH3/SDIO_D4/I2C1_SCL/CAN_RX)

  • I2C1_SDA - PB9 (TIM4_CH4/SDIO_D5/I2C1_SDA/CAN_TX)

SPI

I2C

Since the I2C and UART ports are directly connected to the STM32 device without short-circuit or ESD protection resistors, they are more vulnerable to failure or lock-up than the regular Digital I/O. easyC and ROBOTC users of the VEX Motor Encoders have found that static built up from driving on the field can discharge through the motor casing and the IME chain into the Cortex, causing a possible lock-up and crash.

Other peripherals

A Digital-to-Analog Converter (DAC) peripheral is exposed on the speaker (SP) port. If this port is not being used for analog input or SPI, an analog voltage can be output on this pin. It ranges from about 0.1 to 3.2 V, but is high-impedance. For practical usage of this pin, an operational amplifier must be used to buffer the output.

Several of the built-in timer modules also have exposed capture/compare pins on the available outputs, possibly allowing a VEX Power Expander to run off of a digital port and increase the number of independent output signals. Sophisticated schemes for PWM output or pulse accumulation/width measurement can also be implemented.

External port details

Teams Contributed to this Article:

If the VEX Cortex is not working properly, look at the three indicator lights on the Cortex microcontroller. The most common solution is restarting both the and the Cortex; if the Cortex still fails to operate, downloading the firmware is probably the next step.

Motor ports provide little or no power - The battery is low, or too much power was drawn from the ports, tripping a . Wait a few minutes and try again, or disconnect some motors from the VEX Cortex to lighten the load.

Sensors not working properly - A backup battery should be connected to maintain power to sensors. Sensors work differently when the VEX Cortex is powered from a powered programming adapter or the orange USB A to A cable. Always test sensors with a connected and in use.

Code download stops midway - Downloading large files exposes problems with . Go through and optimize the program, or download using the USB tether instead of over wireless.

Cortex will not turn off - When a backup battery is connected, turn off the first and allow the VEX Cortex to lose the connection before powering down to avoid this issue.

The digital, serial, I2C, and analog pins on the Cortex microcontroller are actually given different names by the microcontroller's registers. By mapping these pins with a test program, the following pin to port map was derived:

By using the second peripheral, one can find its RX pin exposed on analog 4 and its TX pin exposed on analog 3. Its CK pin is also exposed on the SP pin. Combined, these pins form an device, with MOSI on analog pin 3, MISO on analog pin 4, and SCK on the SP pin. CS can be performed by any free GPIO on the digital, analog, or communication ports.

The built-in port is linked to I2C1 on its alternate pin mapping. It is used to connect to the . EasyC, RobotC, and PROS all support use of the port; only PROS allows connection of custom sensors such as as well.

The Crystal ports and Communications ports are connected directly to their outputs. However, Digital ports have a series 1 Kohm resistance to provide short-circuit protection and a 1 nF capacitor for decoupling, limiting their and accordingly. Analog ports have a voltage divider which makes 5 V inputs safe for the 3.3 V ADC with a total input impedance of around 28 Kohms and an anti-aliasing 3dB bandwidth of 16 KHz. A weak pull-up in processor by default makes Digital inputs float high and Analog inputs idle at about 0.2 V. The Speaker port has a 100 ohm series resistor and no capacitor.

(Purdue SIGBots)

⚡
VEX Joystick
Resettable Fuse (PTC)
VEX battery
VEXNet
VEX Joystick
GPIO
UART
SPI
I2C
VEX Motor Encoders
gyros
Slew Rate
Output Drive
BLRS
PROS
Easyc
Robotc
VEX Power Expander
VEX Sensors
VEX Motors
VEXnet
RobotC
Power consumption