CrcDuino: détails matériels
Cette page présente les différentes composantes physiques qui se retrouve sur une carte électronique CrcDuino. C’est une lecture assez chargée, mais elle en vaut la peine!
All voltage values given on this page are using a GND
pin as reference. All GND
pins are connected to one another, so using any of them in all situation is acceptable.
Page table of content
- 1 Page table of content
- 2 Components physical layout
- 3 I/O
- 3.1 Analog inputs
- 3.2 Digital I/O
- 3.2.1 Digital input
- 3.2.2 Digital output
- 3.3 PWM outputs
- 3.4 Communication ports
- 3.4.1 SPI Communication Port
- 3.4.2 I2C Communication Port
- 3.4.3 SERIAL Communication Port
- 3.5 Encoder Port
- 3.5.1 ENCO Port
- 4 Micro-controller
- 5 Power terminals and power supply circuits
- 6 Status LEDs
- 7 Neopixel LED
- 8 Reset Button
- 9 XBee Module - Optional
- 10 Temperature sensor - Optional
- 11 Board Revision
- 12 Articles liés
Components physical layout
I/O
I/O are the way for robot controllers like the CrcDuino to interact with the outside world. They are .100” pitch male terminals. These are widely used in the hobby electronics world, making it easy to find compatible sensors and actuators.
To use the I/O in your code, use the appropriate:
To avoid damaging the micro-controller, the current drawn from any individual SIG
, MISO
, MOSI
, SCK
or SS
I/O pin of the CrcDuino should never exceed 20mA and must never exceed 40mA. The total current drawn from all the SIG
, MISO
, MOSI
, SCK
or SS
I/O pin of the CrcDuino must never exceed 200mA.
Analog inputs
Analog inputs are used to transform voltage from the outside world into a digital value that can be used for calculation by the micro-controller.
4 analog pin sets, called ports, are available on the board. Each port consists of 3 pins:
SIG
: The signal pin, the pin to apply the voltage you want to read to.5V
: Continuous 5V voltage pin. Most sensors require this continuous 5V feed to operate. If the LED marked “5V” right above the “DIG” mark is not lit, no 5V continuous signal will be available on those pins.GND
: Ground pin.
The board will transform the voltage between a given SIG
pin and GND
into a digital value thanks to the 10-bit analog to digital converter built into the micro-controller. Analog pins can read voltage values ranging from 0V to 7.5V and transforms them into a digital value ranging from 0 to 1023 when using CrcLib::GetAnalogInput()
.
Digital I/O
Digital I/O are used to read or write digital signals. A digital signal is a signal that can only take 2 values: True or False.
True is often represented by the number 1, or
HIGH
in the Arduino jargon, and is characterized by the presence of voltage.False is often represented by the number 0, or
LOW
in the Arduino jargon, and is characterized by the absence of voltage.
12 digital pin sets, called ports, are available on the board. Each port consists of 3 pins:
SIG
: The signal pin, the pin that will read or give the signal.5V
: Continuous 5V voltage pin. Most sensors require this continuous 5V feed to operate. If the 5V LED right above the “DIG” mark is not lit, no 5V continuous signal will be available on those pins.GND
: Ground pin.
Digital input
Use CrcLib::SetDigitalPinMode()
to configure a digital I/O as an input. Once configured, use CrcLib::GetDigitalInput()
to read wether voltage is applied on the SIG
pin of the concerned port or not.
The input voltage threshold for the
HIGH
→LOW
transition is around 2.1V.The input voltage threshold for the
LOW
→HIGH
transition is around 2.6V.
Digital output
UseCrcLib::SetDigitalPinMode()
to configure a digital I/O as an output. Once configured, use CrcLib::SetDigitalOutput()
to read wether voltage is applied on the SIG
pin of the concerned port or not.
PWM outputs
12 PWM pin sets, called ports, are available on the CrcDuino. Each port consists of 3 pins:
SIG
: The signal pin, the pin that will read or give the signal.5V
: Continuous 5V voltage pin. Most sensors require this continuous 5V feed to operate.PWM port #1 to #4: No 5V voltage is supplied on the center pin. These ports should therefore only be used for applications that do not require a 5V continuous power. Standard and continuous servos won't work on these ports. Electronic Speed Controllers (ESCs, like the Victor SPx) will work, since they take their control power from the 12V battery instead of the 5V supply from the 3-wire control cable.
PWM port #5 to #8: These 4 ports are supplied by the same power supply. A maximum total of 1A can be drawn from the
5V
pin of ports #5 to #8. If the 5V LED marked “A” right above the “PWM” mark is not lit, no 5V continuous signal will be read on the5V
pin of PWM #5 to #8.PWM port #9 to #12: These 4 ports are supplied by the same power supply. A maximum total of 1A can be drawn from the
5V
pin of ports #9 to #12. If the 5V LED marked “B” right above the “PWM” mark is not lit, no 5V continuous signal will be read on the5V
pin of PWM #9 to #12.
GND
: Ground pin.
Communication ports
Communication ports are used to communicate with the outside world using various communication protocols relying on a series of timely organized digital impulses.
SPI Communication Port
The Serial Peripheral Interface (SPI) port is a set of 4 digital I/O pins that adds SPI communication capabilities to the CrcDuino when used with the Arduino standard SPI library. The port consists of 6 pins:
SS
: The Slave Select pin.SCK
: The Serial Clock pin.MOSI
: The Master Output, Slave Input pin.MISO
: The Master Input, Slave Output pin.5V
: Continuous 5V voltage pin. If the 5V LED right above the DIG mark is not lit, no 5V continuous signal will be available on this pin.GND
: Ground pin.
I2C Communication Port
The Inter-Integrated Circuit (I2C, pronounced I-squared-C) port is a set of 2 interrupt-capable digital I/O pins that adds I2C communication capabilities to the CrcDuino when used with the Arduino standard Wire library . The port consists of 4 pins:
SDA
: The Serial Data Line pin. This pin is aligned with the “MISO” mark of the SPI port.SCL
: The Serial Clock Line pin. This pin is aligned with the “MOSI” mark of the SPI port.5V
: Continuous 5V voltage pin. If the 5V LED right above the DIG mark is not lit, no 5V continuous signal will be available on this pin.GND
: Ground pin.
SERIAL Communication Port
The serial port, also known as UART or USART, is a set of 2 interrupt-capable digital I/O pins that adds UART communication capabilities to the CrcDuino when used with the native Arduino Serial communication functions. It is linked to Serial Port #1 of the ATMEGA2560-16AU micro-controller controlling the CrcDuino. The port consists of 4 pins:
TXD1
: The TX pin. This pin is aligned with the “MISO” mark of the SPI port.TRX1
: The RX pin. This pin is aligned with the “MISO” mark of the SPI port.5V
: Continuous 5V voltage pin. If the 5V LED right above the DIG mark is not lit, no 5V continuous signal will be available on this pin.GND
: Ground pin.
Encoder Port
Encoder ports are meant to be used to read digital signals coming from a quadrature encoder.
ENCO Port
The encoder port is a set of 2 interrupt-capable digital I/O pins that are meant to read digital signals coming from a single quadrature encoder when used with an encoder library. 1 encoder needs two separate inputs. We recommend using Paul Stoffregen’s library named Encoder, as detailed here. The port consists of 4 pins:
ENCO_A
: The pin reading the A-channel of the encoder. This pin is aligned with the “MISO” mark of the SPI Communication port.ENCO_B
: The pin reading the B-channel of the encoder. This pin is aligned with the “MOSI” mark of the SPI Communication port.5V
: Continuous 5V voltage pin. If the 5V LED right above the DIG mark is not lit, no 5V continuous signal will be available on this pin.GND
: Ground pin.
Micro-controller
The micro-controller is the brain of a robot. This black chip is where the magic happens. The chip reads information (inputs) from the outside world (the robot's sensors, the remote controller, etc.), treats this information according to the program downloaded inside it and then enacts the appropriate action (through outputs) to the outside world (the robot's servo-motors, ESCs, etc.). To learn more about micro-controllers and how they work, here's a good read.
The micro-controller controlling the CrcDuino is a ATMEGA2560-16AU. It is the same chip that equips the ArduinoMega2560. Therefore, if native Arduino functions are used, many of the examples on the web related to the Arduino Mega 2560 will apply. Refer to CrcLib.h
for the #define
instructions mapping the native Arduino pin names to the pin names detailed here.
Interrupt capabilities
The following pins are interrupt capable pins, meaning that they can be used to trigger interrupt service routines instead of their usual use as I2C or Serial pins. Interrupt-capable pins could also be used as regular digital IO pins if needed.
In the CRC Robotics Competition context, interrupt capable pins would mostly be used to monitor motor encoder tracks but they can be used for any other task requiring interrupt input capability. If you do not use more than a single encoder on a robot, we recommend that you use the ENCO
port to monitor it, to keep the I2C and Serial communication capability of the board available.
CRC_I2C_SDA
CRC_I2C_SCL
CRC_SERIAL_TX1
CRC_SERIAL_RX1
CRC_ENCO_A
CRC_ENCO_B
Micro-controller timers - information for advanced users
The ATMEGA2560-16AU is equipped with 6 timers. If you use the native Arduino function analogWrite() , make sure the PWM outputs used do not rely on timers that are used by CrcLib
functions. For more information, refer to this link.
Timer0: 8bit timer. Used by
CrcLib::Update()
.Timer1: 16bit timer.
Timer2: 8bit timer. Used by
CrcLib::Update()
.Timer3: 16bit timer.
Timer4: 16bit timer.
Timer5: 16bit timer. Used by
CrcLib::InitializePwmOutput()
andCrcLib::SetPwmOutput()
.
Power terminals and power supply circuits
These green terminals power the CrcDuino with electricity. Internal circuitry brings the 12V power coming from the robot battery to a more convenient 5V and 3.3V. Refer to this page for more information!
The total supply of the following 3 power supplies is PTC limited to 2.35A @ 12V.
5V
pins of PWM ports #5 to #8 are supplied by a dedicated 1A @ 5V power supply.5V
pins of PWM ports #9 to #12 are supplied by a dedicated 1A @5V power supply.5V
pins of all DIO, ANA and communication/encoder ports are supplied by a dedicated 0.350A @5V power supply.
The micro-controller is supplied by a dedicated 5V power supply which is PTC limited at 300mA @ 12V.
The Xbee module is supplied by a 3.3V voltage regulator. This voltage regulator is fed by the 5V micro-controller power-supply.
Status LEDs
These LEDs are used for debugging purpose.
CPU
: CPU power indicator. Lits when 3.3V is fed to the Xbee module, which also implies that 5V is fed to the micro-controller. Beware: this LED is back fed by the micro-USB connector and will therefore light up if the USB cable is connected to the board and a computer, even if no 12V supply is applied to the power terminals.ST
: Status indicator. Flashes periodically to indicate the program is running normally. Will change state approximately each second when running the most basic program, containing onlyCrcLib::Initialize()
andCrcLib::Update()
Fail
: Failure indicator. Lits when the board is in Error mode. Refer to the Error Codes page for more information.X1
: XBee status light X1. Lits when the Xbee module is at the ON state.X2
: XBee status light X2. Lits when the Xbee module is connected to another Xbee module. When the connection is lost, it may take a couple of seconds before the LED goes out.X3
: XBee status light X3. Flashes when the Xbee module is operating properly.
Neopixel LED
The Neopixel is an RGB LED light used by CrcLib for error diagnosis. Refer to the Debugging - CrcLib Error Codes page to understand what error each color pattern corresponds to.
Reset Button
When the reset button is pressed, power to the micro-controller is cut. When released, the micro-controller powers back up and starts executing its code from the beginning.
XBee Module - Optional
The Xbee module is an optional device that can be easily installed or removed from the CrcDuino. The Xbee module is required to use the remote controller capabilities made possible by CrcConnect. For more information, refer to the CrcConnect page.
Temperature sensor - Optional
Although not factory installed, a LM35D temperature sensor can be installed on every CrcDuino board and its data accessed using the analog input defined as CRC_LM35D
. It can be easily soldered in the dedicated holes right below the “Q240” marks on the board, respecting the pin polarity indicated by the truncated oval mark on the board.
Board Revision
Since CRC Robotics always wants to improve, different hardware generations exist to keep up to date with technological advances and/or improve the design and functionality of the board. Because of these hardware changes, stuff might be wired differently on the board, sometime causing the pin numbers associated with certain functionality on the chip change between hardware revision. To avoid problems, the most up to date CRCLib associated with the hardware revision should be used.
9880A: Generation A. Initial Beta release.*
9880B: Generation B. Improved power supply circuitry to better handle battery voltage drops caused by power motors in-rush current. No impact for CrcLib.
*All 9880A boards in circulation have been upgraded to be equivalent to a 9880B board.