Geduino was designed and built around the UDOO Quad board and the reason is obvious: it was the first board combining the power of a Linux-based PC with the flexibility of Arduino, all in one board. When UDOO team announced the release of a UDOO based on X86 processor I was really excited; when I saw the technical specification of UDOO X86 Ultra it was like all my wishes had been fulfilled!
The pinout of UDOO X86 looks like the one used in UDOO Neo: its based on the classical Arduino pinout surrounded by the pins connected to the Braswell. Unfortunately the Braswell is based on 1.8V logical so we cannot directly connect it to 3.3 or 5V device (this limit refer only to the Braswell pins: the Arduino pins are fully tollerant to 5V). Anyway this is not a big issue: we can easily use such devices without a big effort! On this post I will explain how you can use a 5V devices like an Arduino UNO connected via UART to the Braswell side of UDOO X86. Of course the same can be applied for 3.3V devices.
First we have to locate CN13 and CN15 connector on UDOO X86 board:
UDOO X86 - CN13
Curie | Braswell | ||
---|---|---|---|
SCL | 19 | 20 | 1.8V |
SDA | 17 | 18 | GND |
AREF | 15 | 16 | BUF_PLTRST |
GND | 13 | 14 | LPC_SERIRQ |
D13 | 11 | 12 | LPC_CLK |
D12 | 9 | 10 | LPC_FRAME |
D11 | 7 | 8 | LPC_AD3 |
D10 | 5 | 6 | LPC_AD2 |
D9 | 3 | 4 | LPC_AD1 |
D8 | 1 | 2 | LPC_AD0 |
UDOOX86 - CN15
Curie | Braswell | ||
---|---|---|---|
D7 | 15 | 16 | UART2_RXD |
D6 | 13 | 14 | UART2_TXD |
D5 | 11 | 12 | UART2_CTS |
D4 | 9 | 10 | UART2_RTS |
D3 | 7 | 8 | UART1_RXD |
D2 | 5 | 6 | UART1_TXD |
TX - D1 | 3 | 4 | UART1_CTS |
RX - D0 | 1 | 2 | UART1_RTS |
The UARTs on Braswell side of CN15 use 1.8V logic: in order to connect them to a device with different voltage we have to use a bi-directional logic level converter like BOB-12009 provided by Sparkfun.
This component can convert 5V (or other) logic to 1.8V logic: means that when high voltage side became HIGH (i.e. 5V) the low voltage side became HIGH (i.e. 3V) too. Furthernore it is bidirectional so the translation works also from low voltage side to higher.
The connections are really simple: HV must be connected to the high voltage reference (i.e. 5V), LV to the 1.8V reference of Braswell and, of course GND must be connected to ground. The BOB-12009 has four independent channels named HVx-LVx.
On this tutorial we will connect:
- UART2_RX on CN15 to LV3
- UART2_TX on CN15 to LV4
- TX on Arduino to HV3
- RX on Arduino to HV4
Test connections
Now our UDOO X86 is connected to Arduino via UART and we only need to test communication. We will use a simple HelloWorld Arduino sketch like this in order to send data to UDOO X86:
void setup() { Serial.begin(115200); } void loop() { Serial.println("Hello World!"); delay(1000); }
In order to see the received message on UDOO X86 (I assume you are using Ubuntu on your UDOO 😉 ) you have to open a terminal and type following command (UART1 is represented as /dev/ttyS4 and UART2 as /dev/ttyS5):
minicom -D /dev/ttyS5 -b 115200
Minicom will start showing the data received by UART2:
Welcome to minicom 2.7 OPTIONS: I18n Compiled on Jan 1 2014, 17:13:19. Port /dev/ttyS5, 19:35:24 Press CTRL-A Z for help on special keys Hello World! Hello World! Hello World!
Using this kind of low-cost and easy to use component you will not have problem interfacing your device with UDOO X86!
Note
The four channels provided by BOB-12009 are independent but all them share the same voltage references: that mean that all channels convert from the LV to the same HV! If you need to connect a 3.3V device to UART1 and 5V to UART2 you cannot use a unique BOB-12009!
On Sparkun site the schematic of BOB-12009 is available for download: consider the possibility to use the schema to create your own logic converter on your PCB!
Note
If minicom is not present on your Ubuntu you can install it typing:
sudo apt-get install minicom