Selecting a Dev Board¶
Whenever you start a new project (or robot), you need to have some processor, and easy access to the IO pins on it for interfacing with other devices (such as sensors, motors, and a computer for programming). The easiest way to do this, is to find a Dev Board (or Single Board Computer), which provides a microcontroller (uC), and associated circuitry to make powering, programing, and using the uC easy.
- Selecting a Dev Board
- Core Types
- Distinguishing Features
- Boards List
- Other guides
There are three standard voltages common with ICs (and several others that are becoming more prevalent as time passes). The big three are 5V, 3.3V, and 1.8V. The newer an architecture is, the lower the voltage it is likely to operate at. It is to directly connect devices that are designed to operate at different voltages. Outputting a higher voltage into an input designed to take a lower voltage will likely burn it out, and destroy the chip (let out the magic smoke). Outputting a lower voltage into an input designed to take a higher voltage will possibly have no effect.
Translating Digital Logic Levels¶
For digital logic, there are ways to convert voltages. The cleanest way is to use a level shifter. This is a component designed to take two voltages, and convert logic signals between them. However, that may be too costly, or unavailable. There are a few hacks to do level shifting without a level shifter.
High to low: Use a voltage divider: a pair of resistors in series. The high voltage output connects to the end of the top resistor, and the low voltage input connects to the middle of the two resistors. The bottom of the divider, and ground of both ICs should be connected. For 5V to 3.3V, the ratio of the resistances should be 1:2 (top to bottom). For 3.3V to 1.8V, the ratio of the resistances should be 5:6 (top to bottom).
Low to high: test, test test. Digital inputs don't determine high and low only at the max and minimum voltages. There is a threshold in between, above which an input will register as high, and a second threshold below which an input will register as low. Between these thresholds, you are given no promises, so don't have digital inputs between them. For example, the threshold for a 5V AVR has an high threshold of about 2.7. Therefore, if you are sending a digital signal from a 3.3V device to the 5V device, it (the 5V device) will likely be able to receive it (the digital signal) (assuming both share the same ground).
These uC's are programmed in C or C++ (usually), with the code running directly on the hardware (hence they will be described as Bare Metal). The uCs are designed to run at low powers and be made for very little cost. Therefore, they usually run at low speeds, have little memory, and limited features. You may be able to find these uC's in the club (as part of the electronics stock), or buy them for about $2.
32 bit ARM¶
These uC's are programmed like the 8/16 bit ones, with bare metal code, usually written in C or C++. However, the architecture of these boards is ARM based. This means they share a common (and popular) instruction set, even when made by different manufacturers. Usually every GPIO pin can be used to trigger an intterupt (ISR). Because of the rise of smartphones, the cost of fabricating ARM chips has fallen significantly in the past few years, and therefore the cost of these boards are falling as well.
These boards are treated more like small computers than dev boards. Instead of writing bare metal code, you write a program, and run it like any other on a desktop/laptop/server. The advantage here is that you can have multiple things running at once. The disadvantage is that the hardware IO is often abstracted away, and therefore not as easy to access. Then again, some things are easier, since drivers are already written (for example, you can use the whole network stack, instead of building and sending your own ethernet frames). They usually have a 32 bit ARM processor.
What do you plan on using this board for? How complex will the behaviors be? Will it need to interact with other computers? How fast/how much memory does it need?
Logic Voltage Level (VCC)¶
You can only directly connect to other boards, sensors, actuators, ICs, etc. at the same VCC. Will you have to do level adjustments for just one thing? For many? Can you get away without it?
USB Serial is useful for programming (you don't need an FTDI (USB - Serial adapter)) or a programmer. It also usually provides you with a serial console which is useful for debugging. It also provides 5V power in.
Number of GPIO pins¶
GPIO (General Purpose Input Output) lets you do digital signaling. How many digital inputs and outputs do you need? Remember that many (if not most or all) of these pins do double duty as another pin type (described below). Will you have enough for what you need?
Number of Analog input pins¶
The ADC (Analog to Digital Converter) converts analog inputs to digital ones. It has multiple input channels, which are connected to some number of pins. How many channels of analog input do you need? Also keep in mind, if you don't want to measure voltages relative to VCC, there is usually a Vref pin (which becomes the reference voltage that the ADC pins are compared to).
Number of PWM pins¶
PWM (Pulse Width Modulation) pins are pins hooked up internally to timers so they can be set to toggle automatically at a frequency and duty cycle. These can be used for controlling motors, servos, and simulating analog voltages (hence they are sometimes set with an analogWrite() function). Simulating an analog voltage (between 0 and VCC) is done by switching back and forth between 0 and VCC (much like how Pittsburgh simulates Spring and Autumn by rapidly switching between Summer and Winter). How many do you need?
Number of DAC pins¶
A DAC (Digital to Analog Converter) is used to produce analog voltages. Unlike a PWM pin, it actually produces a constant analog voltage. These can be used to create reasonable audio output (so on some boards they are already hooked up to a headphones port).
Number of hardware UARTs (or USARTs)¶A UART (Universal Asynchronous Receiver and Transmitter) or USART (Universal Asynchronous/Synchronous Receiver and Transmitter) is used to send and receive serial communication. This is known as Serial (other types of serial communication usually go by other names), and may often be referred to by the voltage level it operates at:
- 12V: RS232
- 5V/3.3V: TTL Serial
If the board has USB Serial, it either has one UART hooked up to a FTDI (or other IC to convert TTL Serial to USB signaling) or has native USB capability. If it has a UART hooked up to do USB, then that UART may or may not also be exposed as pins for use otherwise. If that UART is not exposed as pins, there are most likely other UARTs that are. It is difficult to find a board without at least one UART exposed. Remember, that Serial is point-to-point, not a bus protocol. Therefore only two devices may be connected (normally). UARTs can also be simulated in software, but those are slower, and may not be able to operate at high speeds (or may significantly slow down your program).
Number of I2C buses¶
I2C (I Squared C, or TWI (Two Wire Interface)) is a bus-based synchronous serial protocol. It lets multiple devices all share a single data connection. There must be at least one master device (although it is usually one), and one or more slaves. It is known to be somewhat temperamental with regards to the electrical properties of your circuit, but is usually fairly easy to work with. It is not as fast as SPI. You usually only need one I2C bus per board, but some have multiple (so you can be on multiple networks). These pins are labeled SDA (data) and SCL (clock). Most boards will have at least one I2C bus.
Number of SPI buses¶
SPI (Serial Peripheral Interface) is a bus-based synchronous serial protocol. It lets multiple devices all share a single data connection. This must have one master for each bus. The pins are MISO (Master In Slave Out), MOSI (Master Out Slave In), SCK (Clock), and one or more Select lines. The first three are shared between all devices on the bus. One Select line is run from the master to each slave. The Master determines who it is talking to (and which slave may write to the MISO line) by changing the value on the Select lines. If there are only two devices, the Select line is often not necessary. Most boards will have at least one SPI bus. The pins may be part of the programming header (particularly for Atmel uC's). You can also use SPI to communicate with SD cards (but not at high speed).
Presence of CAN bus¶
CAN (Controller Area Network) bus is a priority based serial packet bus. It is often used in the automotive industry, and in systems where message priority is important. This is usually found only on more advanced boards. Will you be interacting with other automotive devices?
USB HID capability¶
USB HID (Human Interface Device) lets your uC act like a keyboard, mouse, joystick, game controller, or other device that supports the HID protocol. If you are trying to interact with a computer by sending it text to any program, without having to make a driver to support your device, this is extremely useful. You can pretend to be a keyboard, and just send the key presses for the text you want to send. Will this capability help you?
USB OTG or Host capability¶
USB OTG (On the Go) and Host lets you communicate with other USB devices that aren't necessarily a computer. This can include USB HID devices (so you can have a keyboard/game controller sending signals to your device without needing a computer).
You can connect directly to a network to send messages back and forth. This will most likely operate at 10/100 Mbit speeds.
Interrupts let you set functions to be called whenever a pin goes high, low, or changes. Diferent uC's allow different numbers of pins to be used to trigger ISRs (Interrupt Service Routines). If you have a quadrature encoder, you will want two interrupt pins to read it. ARM uC's usually enable any GPIO pin to be an interrupt pin. How many do you need?
8/16 bit Bare Metal Boards¶
Arduino 168/328 Boards¶
Usually run at 16MHz, 14 GPIO, 5V. The 168 boards are just older, and have half the RAM/FLASH/EEPROM. Otherwise same functionality.
- The standard that you know and love
- SMD version is essentially the same
- Duelimanove is just an older version of this. Same core features.
- Nano. Like the Uno but:
- Mini USB connector
- Fits in a breadboard
- 2 more analog input pins
- Pro. Like the Uno but:
- No pins attached.
- No FTDI
- Need external FTDI to program, no built in USB
- Comes in two flavors:
- Pro Mini. Like the Pro but smaller.
Arduino 32U4 Boards¶
Very similar to the 328 family, but the 32U4 has integrated USB capabilities, so these all have HID functionality.
- Looks like the Uno, but with micro USB connector
- Leonardo but the size & shape of the Nano
- Leonardo + Ethernet + Wifi (includes a second core running OpenWRT) + USB Host
- All the IO of an Uno with the networking capabilities of a home router in one package.
TI Launchpad MSP430¶
32 bit ARM Bare Metal Boards¶
TI Launchpads: Stellaris and Tiva C¶
Tiva C is just the new version of the Stellaris, but has essentially the same capabilities and pinout.