This is only a preview of the March 2019 issue of Silicon Chip. You can view 34 of the 104 pages in the full issue, including the advertisments. For full access, purchase the issue for $10.00 or subscribe for access to the latest issues. Articles in this series:
Items relevant to "Ultra low noise remote controlled stereo preamp, Pt.1":
Items relevant to "Our new DAB+ Tuner with FM and AM – Part 3 ":
Items relevant to "Touch controlled all-diode checker and plotter":
Items relevant to "Versatile Trailing Edge Dimmer – Part 2 ":
Items relevant to "El Cheapo Modules 23: Galvanic Skin Response":
Purchase a printed copy of this issue for $10.00. |
“Hands On” review by
Tim Blythman
NEW FROM
MKR VIDOR 4000
This newest Arduino FPGA board sports a 48MHz 32-bit processor with 256KB
flash and 32KB RAM, extra flash and RAM, onboard WiFi and Bluetooth,
HDMI video output and camera interface connectors, a battery charge
controller, cryptography chip and a large field programmable gate array
(FPGA). It can be plugged directly into a breadboard for experimentation.
A
rduino boards are very popular and have spawned many
clones and copies. There is no
doubting the attractiveness of the ATmega328-based Uno and its other 8-bit
relatives such as the Mega and Nano
(both described in the December 2018
issue; see siliconchip.com.au/Article/11335).
But the Arduino company has not
stood still and they continue to release
even more powerful boards.
The Arduino MKR Vidor 4000 is
their latest product. They have released
quite a few boards since the Uno, but
none have reached the same level of
popularity.
Many of the newer boards, such as
the Due, now use 32-bit ARM processor
rather than the 8-bit AVR chip, and the
MKR (short for “maker”) series of boards
have also changed to a more compact,
siliconchip.com.au
breadboard friendly pin layout. These
new chips have a 3.3V maximum supply voltage and have 3.3V I/O levels,
compared to a typical 5V for the AVRs.
The newer boards have many extra
features compared to the Uno/Nano/
Mega, especially for wireless communications, as it is expected that these development boards will be used in “IoT”
(Internet of Things) type applications.
Vidor details
The Vidor’s main processor is a Microchip ATSAMD21 (ARM Cortex-M0+
processor), with 256kB of FLASH memory and 32kB of SRAM. It operates at
48MHz and has 22 I/O pins. As mentioned above, these I/Os have a 3.3V
swing.
It has 12 pulse-width modulation
(PWM) outputs, seven inputs to the
analog-to-digital converter (ADC) and
Australia’s electronics magazine
a single 10-bit digital-to-analog converter (DAC) which can be routed to
a specific pin. It can also operate as a
USB device or host.
There’s also an 8MB RAM chip and
2MB flash memory chip on the board,
in addition to the central processor’s
internal memory.
The Vidor includes a U-BLOX NINA
W10 WiFi/Bluetooth module. This is
a variant of the ESP32 IC, the bigger
brother of the ESP8266 (described in the
April 2018 issue; see siliconchip.com.
au/Article/11042). This contains an embedded 32-bit microcontroller which
could, on its own, be programmed by
the Arduino IDE.
The same WiFi/Bluetooth module
also appears on the new Uno WiFi Rev2
board, released around the same time
as the MKR Vidor 4000.
The Uno WiFi Rev2 retains the clasMarch 2019 71
NINA W10 WiFi and
Bluetooth Module
10CL016
FPGA
GPIO
Header
2MB
FLASH IC
32.768kHz
Watch Crystal
Battery
Connector
Reset
Tactile Switch
Mini PCI-E Connector
(board edge)
Micro
USB Socket
MIPI Camera
Connector
Green
LED
Type D MicroHDMI Socket
GPIO
Header
CryptoAuthentication
IC
8MB
RAM IC
SAMD21 Processor
J3 Header
Like many recent Arduino boards (and unlike the early ones),
it’s built almost entirely from surface-mount devices. This view
shows the top side of the PCB and identifies major components.
Both of these labelled photos are shown significantly over size
(for clarity – actual PCB size is only 83 x 23mm, as shown inset at
right).
sic Uno form factor but uses the slightly
more powerful ATmega4809 8-bit processor. That would be a good one to use
if you are familiar with the Uno and
need the WiFi feature but not any of
the other features of the Vidor.
Helpfully, the Vidor pin numbers are
printed on the side of the headers, including alternative pin functions (eg,
SPI and I2C) as appropriate. This is
necessary because there is little room
on the top of the PCB itself for pin designations.
Most of the pin designations are also
printed on the underside of the board.
The main components of the board
are highlighted in the adjacent photos.
Items of note include the TI BQ24195LRGET battery charger IC and the Microchip ATECC508A Crypto-authentication IC. The ATECC508A provides
hardware acceleration of AES and oth-
er secure network connections such as
TLS, and is connected to the micro via
an I2C bus.
The battery charger IC connects to
the USB port and can detect the USB
host’s charging capability. The IC also
connects to the ATSAMD21’s I2C bus
for charge control and monitoring.
The underside of the board also
sports two unpopulated headers. There
is a space for a six-pin 0.1-inch pitch
header and a ten-pin 0.05-inch pitch
header.
Both of these sets of pads are routed
to the ATSAMD21, for access to the Serial Wire Debug (SWD) and JTAG debugging/programming interfaces.
Onboard FPGA
But the most unusual feature of this
Arduino board is that it incorporates
an Intel Cyclone 10CL016 FPGA. The
Mini PCI-E Connector
(board edge)
FPGA is hooked up to most of the board
I/O pins, as well as the micro HDMI
socket and the MIPI camera connector.
This FPGA gives the MKR Vidor
4000 capabilities beyond a plain microcontroller, but perhaps not quite as
advanced as a fully-fledged computer.
A Field Programmable Gate Array is
an array of logic gates (like practically
any logic IC or even microcontroller)
which is programmable after it has left
the factory (ie, “in the field”).
Being an array of gates, in effect,
everything on an FPGA happens in
parallel, rather than in a serial, oneat-a-time fashion as is the case with
microcontrollers.
This means that FPGAs are great for
digital signal processing, such as audio
and video compression/decompression, and even AI-like tasks such as
image recognition.
Voltage
Regulator IC
Battery
Charger IC
JTAG Header
Serial Wire Debug
(SWD) Header
Similarly, here is the underside of the board with maor components identified.
72
Silicon Chip
Australia’s electronics magazine
siliconchip.com.au
Fig.1: the board profile for the Arduino MKR Vidor 4000
can be found by searching for “vidor” in the Arduino IDE’s
Boards Manager window.
Fig.2: we recommend installing these three libraries to use
with the MKR Vidor 4000. There don’t appear to be any
third-party libraries specific to the Vidor just yet.
In theory, given enough internal
gates, an FPGA can provide the functionality of just about any digital IC,
and in fact, FPGAs are often used in
the design stage of ASICs (application
specific integrated circuits), including some CPUs, to test the design before the final chips have been manufactured.
What that means in practice is that
the FPGA can be reprogrammed to
provide different hardware functions
depending on what is needed for the
project at hand.
In terms of complexity, programming an FPGA is a step above programming a microcontroller. But with the
Vidor 4000, you don’t usually need to
worry about that.
The Arduino integrated development environment (IDE) contains
pre-compiled FPGA software or “IP
blocks” which are loaded into the flash
memory during the upload process.
Just like libraries, they provide functions that can be controlled from the
Arduino program but do not need to
be understood at a deep level.
Out of the box, the FPGA provides
access to the HDMI and camera features on the board, amongst others. But
what the FPGA adds in broad terms is
peripherals.
It is possible to use the FPGA to access extra PWM, I2C, SPI and UART
channels, and these peripherals can be
configured to operate on any I/O pin.
At the moment, Arduino libraries
for the MKR Vidor 4000 may configure the FPGA, splitting some of the
tasks between the main processor and
the FPGA.
While the concept of IP blocks does
siliconchip.com.au
not sound like it is consistent with
the open-source ethos that the Arduino software is known for, the process
for creating IP blocks is open-source.
However, as yet, few people are creating open-source IP blocks.
We understand that soon it will be
possible to create more features for
the FPGA using a web interface and
cloud-based compiler, although this
will likely be in a very different language to the usual Arduino IDE.
It is expected that contributed IP
blocks will greatly expand the usefulness of the MKR Vidor 4000.
Information about creating IP blocks
can be found at: https://github.com/vidor-libraries/VidorBitstream
Getting hold of a Vidor board
Before we could try the Vidor out,
first we actually had to get one, which
turned out to be a bit harder than expected.
When we ordered our MKR Vidor
4000 board from element14, we were
required to complete an import declaration, stating that we would not reexport the unit, nor use it in chemical, biological or nuclear weapons and
that the unit would not be supplied to
a military end user.
Unfortunately, this meant that we
had to put aside our plans for world
domination.
Having completed the declaration,
we received the unit not long after. Besides the board itself, we got a small
sheet of Arduino stickers in the box
and a product guide with warranty
and RoHS-compliance information.
If you are familiar with the Uno, the
first thing that will strike you is how
Australia’s electronics magazine
small the Vidor is. It’s about half the
size of the Uno and is fitted with two
rows of stackable headers. We attached
the unit to a 400-hole breadboard to
avoid damaging the pins underneath.
Software
As with other Arduinos, to program the MKR Vidor 4000, you need
the Arduino IDE software. This includes a code editor, compiler and
upload tools.
Although there is some basic example code available for the MKR Vidor
4000, we would suggest some experience with a simpler board (such as an
Uno) before trying to work with the
MKR Vidor 4000.
We are currently using Arduino IDE
version 1.8.5, which appears to be the
same version as shown in many of the
MKR Vidor 4000 examples.
Although no version number is
given as a minimum requirement for
working with the Vidor, you need version 1.6.4 or later to use the Boards
Manager tool (which we highly recommend for ease of use).
The IDE can be downloaded from
www.arduino.cc/en/Main/Software
but there is also an online-only version of the IDE which you can access
at https://create.arduino.cc/ (you need
to create an account on that website
before you can use it).
Once the IDE is installed, the MKR
Vidor 4000 Board Profile needs to be
installed. The Boards Manager (found
under the Tools → Board → Boards
Manager... menu) is the easiest way
to do this.
Inside the Boards Manager, search
for “vidor” (see Fig.1), click on the
March 2019 73
Fig.3: this shows the output of “VidorTestSketch”. It lists
which IP Blocks are currently loaded into the FPGA. The
list includes support for numerous peripherals.
option shown and click install.
This can take a while, as the entire
SAMD21 toolchain needs to be installed.
Under Windows, this also installs
the MKR Vidor 4000’s USB drivers.
For macOS and Linux, no drivers are
needed.
Once the Board Profile is installed,
we recommend adding some of the
Vidor-specific libraries as well.
These can be installed using the Library Manager (found under Sketch
→ Include Library → Manage Libraries…). Again, simply search for “vidor”.
We suggest you install the Vidor-Peripherals, VidorGraphics, and
WiFiNINA libraries – see Fig.2. The
USBBlaster library is a tool used for
updating the FPGA if you are devel-
Fig.4: an I2C scanner sketch shows two devices on the board
that are pre-connected to the I2C bus. These are the Cryptoauthentication IC (0x60) and battery charge IC (0x6b).
oping your own IP Blocks, and is otherwise not needed.
Adding some extra hardware
We’re intrigued by what can be
achieved by adding a camera to an
Arduino board, but there isn’t much
information about what cameras will
work, except that camera needs to plug
into the board’s “MIPI” connector.
Since this connection appears to be
the same as the commonly available
Raspberry Pi cameras; we tried one and
it worked fine. The camera we used
has “Rev 1.3” printed on it.
These flexible flat cables (FFC) can
be fiddly to plug in. Ensure that the
contacts on the camera cable face
down (towards the Vidor PCB), push
the cable in as far as possible and then
squeeze the black and brown halves of
the connector together.
The Vidor also has a Micro-HDMI
(type D) socket, so to connect to a
monitor, you will need a Micro-HDMI
to full-size HDMI adapter, or a suitable cable.
What can it do?
Now let’s look at what we can do
with all this extra hardware. There
are a few example sketches that are installed along with the aforementioned
libraries. The WiFi examples are numerous, but we won’t delve into these;
the WiFi capabilities of this board are
similar to many other boards.
In fact, given that the WiFi function is supplied by an ESP32 compatible module, the capabilities and
interface will be practically identical
to the ESP32 based boards that can
Above: the output of the “VidorDrawLogo” sketch on an
HDMI monitor. The display has a resolution of 640 x 480.
Right: the “VidorQrRecognition” sketch can identify and
mark, but not decode, QR codes.
74
Silicon Chip
Australia’s electronics magazine
siliconchip.com.au
be programmed by the Arduino IDE.
There are six distinct examples provided within the two main Vidor libraries. The examples can be found under
File → Examples → VidorGraphics and
File → Examples → VidorPeripherals. They only appear when “Arduino
MKR Vidor 4000” is selected in the
Tools → Board menu.
You may need to scroll down if
you have a lot of libraries or boards
installed.
Having loaded an example sketch,
select the correct serial port from the
Tools → Serial Port menu and then
press Ctrl-U to compile it and upload
it to the Vidor board.
One thing we found with the examples is that they all include the line:
while (!Serial);
This means that the Serial Monitor
needs to be opened before the program
will proceed. For these examples, it
worth having the Serial Monitor open
to watch the sketch report what it’s doing, but we were surprised to see the
basic HDMI example fail to output
video just because we had not opened
the Serial Monitor yet.
We tried the “VidorDrawLogo” example first. It displays the Arduino
logo displayed on an attached HDMI
monitor.
Interestingly, a much clearer version of the logo can be seen for about
a second before this; it appears that
the Vidor has its own splash screen
built in, too.
While hardly extraordinary, this is
a great example of how simple it is to
drive an HDMI monitor.
If you have previously used any
graphics type displays with the Arduino IDE, the drawing commands
will be familiar. Although basic, we
expect people will use this feature to
create video games.
We tried the “VidorEnableCam”
sketch next. It takes the video stream
from the camera and displays it on the
HDMI monitor.
Next, we tried the “VidorQrRecognition” sketch. We found a QR code
and held it in front of the camera. The
result is seen in the adjacent photo.
It appears that this sketch will detect
a QR code, but not decode it. The three
marker points are found and flagged
with a cross, but the code does not
have any means of decoding QR codes.
This would be a handy tool for an
Arduino board to have (being able to
siliconchip.com.au
read linear barcodes would also be
useful), but it seems to be just a proofof-concept.
Still, the ability to overlay graphics
over a camera stream raises some exciting possibilities for video processing.
We did not try the “VidorNeoPixelMatrix” (for driving serially addressable RGB NeoPixels) or “VidorEncoder” (for reading quadrature encoders)
examples, but the intent of these demos is clear.
Both these tasks require very tight
timing considerations to work correctly.
By offloading these duties to the
FPGA, the main processor can focus
on doing what it needs to do, but without needing to deal with time-critical
peripherals directly.
The final example is named “VidorTestSketch”. It demonstrates using
both the central processor and FPGA
to control the I/O pins and shows some
information about the IP blocks in the
FPGA – see Fig.3.
for the FPGA, and we may see a future
IP Block providing this feature.
Further experiments
Verdict
While the “VidorQrRecognition”
example shows that it is possible to
process video data with the MKR Vidor 4000, inspection of the source
code shows that there is no easy way
to access the contents of the camera
video stream.
The video processing is done using the FPGA and so is hidden in the
IP Block.
While it’s possible to lay graphics
over the camera stream using regular Arduino code, manipulating and
interacting with the video appears to
be out of reach at the time of writing.
One example of the potential use of
such processing would be to perform
chroma key processing of video.
Also known as “green screen” or
“blue screen”, this involves replacing the colour-coded background of a
video stream with a different image.
For pixels that match the key colour
(ie, blue or green, depending on the
implementation), the background image or video is shown instead.
You would be familiar with this effect from its widespread use in TV
weather broadcasts.
If we could read the contents of the
camera stream, then it would be a simple case of checking each pixel and displaying the foreground or background
as appropriate.
This would actually be an ideal task
The Arduino MKR Vidor 4000 looks
like it’s a very capable device but it’s
a pity that so much of its power is
locked up in the “black box” of the
FPGA IP Blocks.
This means that the examples provided don’t really demonstrate what
it is capable of. Having said that, being able to draw reasonably high resolution (for an Arduino) graphics to an
HDMI display is an excellent feature
in its own right.
We expect that as more people develop IP Blocks, we will see some great
applications for the Vidor.
An FPGA is well suited for highly
parallel tasks such as image recognition and it will be interesting to have
such a feature available on something
smaller than a fully-fledged computer
or small-board computer (SBC) like the
Raspberry Pi.
Just as the multitude of third-party
libraries has made the Arduino ecosystem so flexible, we hope that the community will create some great libraries
for the FPGA side of this board as well.
The Arduino MKR Vidor 4000 is
available from Mouser Electronics
with free delivery.
Australia’s electronics magazine
On the bus
We also noted that the battery charge
IC and crypto-authentication IC are
connected to the I2C bus of the ATSAMD21. We ran an I2C scanner sketch
to see if there were any other devices.
The results are shown in Fig.3. According to the datasheets, the device
at 0x6B is the battery charge IC, and
the device at 0x60 is the Crypto-authentication IC.
The specs of the battery charge IC
indicate that it is a switchmode device
operating at 1.5MHz with an adjustable charge current of up to 2.5A and
efficiency up to 92%.
It can operate from 5V USB power
or 3.9-17V DC.
It also provides a boost regulator
which can be used to provide a 5V rail
from a single-cell lithium-ion battery
and a host of other charge management and power management features.
See: https://au.mouser.com/new/
arduino/arduino-mkr-vidor-4000/ and
https://au.mouser.com/ProductDetail/
Arduino/ABX00022
SC
March 2019 75
|