Design

Arduino is in bloom

18th October 2013
Nat Bowers
0

Since it was announced back in September 2011, interest has been growing for the Arduino platform. Renesas has now entered this arena with one of the fastest Arduino compatible boards – The GR-Sakura – based on an RX63N 32-bit microcontroller operating at 100MHz. Ian Hall, Principal Engineer with the MCU&Tools Group, Industrial & Communications Business Group, at Renesas, explores more in this ES Design magazine article.

Arduino is the open source electronics platform implemented with easy to use hardware and software. Originally conceived for simplifying the development of interactive objects and environments, such as museum or art exhibits, it now has a huge following and user base of hobbyists and anyone looking for an easy way to enter the world of electronics. It’s not limited to the amateur electronics world; Arduino can be used to quickly prototype any system where a programmable microcontroller solution is required. Boards can be purchased in the form of official Arduino boards such as the Uno or, as the platform is open source, can be built from hand or from a plethora of third party suppliers who often add features not found on official boards, such as Ethernet.

One of the key reasons behind Arduino’s success is the availability of shields. Shields are plug-in boards which enhance the functionality of Arduino by adding support for features such as WiFi, Ethernet, motor control and GPS, to name but a few.

As with Arduino hardware, the software is also open source. The Arduino programming language is based on Wiring and the IDE (Integrated Development Environment) based on Processing. Those familiar with C or C++ will feel right at home as the Arduino programming language is a kind of hybrid of C and C++. The benefits of C++’s object orientated programming features such as operating overloading are made available without its complexities, as the source more resembles C. Unlike C or C++ there is no main() function required instead there is a setup() function which runs once at the beginning of the application and a loop() function which runs continuously. A simple application is shown below.

A simple application is shown below.

This code snippet shows some of the programming environment’s many useful functions. There is no need to delve into a device manual to configure an I/O pin as an input or output, as the pinMode() function will do that. Writing to an output port is as simple as calling digitalWrite() and there’s no need for a timer or software loops to add a delay to the application. Other useful built-in functions include those for reading and writing analogue values, getting the uptime of the system in milli or micro-seconds and those for using a serial port interface. On building an application a back-end tool converts the Wiring source into C++ using a GCC toolchain. The resulting binary is seamlessly downloaded, typically via, USB into the board and executed.

The GR-Sakura, or Gadget Renesas Sakura, board from Renesas was first conceived at end of 2011 when Mr Kogure from the company Wakamatsu Tsusho visited Renesas at the Embedded Technology Show. Having seen the explosion of the Arduino platform Mr Kogure was eager to see a home grown Japanese entry into this market and saw Renesas as the obvious partner to achieve this. Within a few months the project was underway led by volunteers from Renesas and the Arduino community. Although the platform uses a Renesas microcontroller Renesas themselves do not manufacture the board.

The first thing that hits you when you see the Sakura board for the first time is its striking pink colour. Sakura means cherry blossom and it is from this that it takes its colour. On a desk covered with traditional blue and green PCBs the Sakura board is easy to spot! There are in fact two versions of the Sakura board called GR-Sakura and GR-Sakura-FULL; the latter is discussed in this article as it is this board that has a LAN connector, USB host connector, power supply jack and MMC card shell, which are not found on the other board. Anyone familiar with the Arduino platform will notice that the form factor of Sakura is the same as boards such as the Arduino Uno. The familiar Arduino signals – IO, Analog-In, SPI, PWM outputs etc are brought out on headers, meaning the Sakura board is compatible with many of the Arduino shields available. One shield however that won’t be needed is the Ethernet shield. The GR-Sakura-FULL board has Ethernet on board as standard provided by the RX63N’s built-in EtherC and E-DMAC peripherals and offering more performance than the standard SPI connected Ethernet interface shield. The Sakura board also features a micro-SD card slot something also found on newer Ethernet shields.

Arduino is in bloom image 2

In addition to the standard Arduino headers the other RX63N pins are brought out to unpopulated headers to allow a developer to make use of all the device’s interfacing capabilities. The Sakura’s USB interface supports USB 2.0 full speed function and OTG (On-The-Go). An additional header is provided for XBEE radio modules such as Bluetooth and WiFi.

One departure from the Arduino norm is the development environment for Sakura. Rather than download the IDE and compiler toolchain, Sakura uses a web compiler environment. This environment generates a Sakura project and can include user selectable libraries for support of IIC (TWI – Two Wire Interface), SPI, LCD and Ethernet for example. Using a web compiler means development is possible anywhere there is an Internet connection. The web compiler is ideal for space constrained development systems or systems with limited privileges such as education environments where it may not be possible to install a traditional IDE. The web compiler environment includes a full editor with the ability to upload externally generated source files if required. When the code is ready to be built the server side GCC compiler springs into action and compiles and links the application. The resulting binary can then be downloaded to the local machine. With the Sakura board connected to the host via USB pressing the red button makes the Sakura appear as an external USB mass storage device to the host computer. Programming the application into the board is as simple as dragging the downloaded binary into the USB drive. The 1MB internal flash memory of the Renesas RX63N is used and once the download is complete the program executes automatically.

Try the environment for yourself. There is no need to create an account although this is necessary to save any of the projects online. The web compiler environment can be found at http://tool-cloud.renesas.com/.

With a powerful 32-bit microcontroller such as the Renesas RX63N with its 1MB of flash, 128kB of RAM, FPU (floating point unit) and powerful integrated peripherals such as Ethernet, serial interfaces, DMAC, 12-bit ADC, temperature sensor and timers to name but a few, the situation may arise where the user wishes to use the board in a bare metal configuration rather than in Arduino mode. The board supports this with a debugger header for Renesas’ E1 low cost JTAG debugger. For offline development the community has already made available a demo project which can be imported into Renesas’ latest Eclipse based IDE called e2studio. e2studio is a complete development and debug environment based on the popular Eclipse CDT project. The Sakura demo project uses the GNURX GCC compiler from KPIT (www.gnurx.com) and along with e2studio is a completely free of charge development system.

Development is not limited to the web compiler or the traditional IDE. Code can be developed using the Android platform with the Sakura board being connected directly via USB to a suitable tablet or phone. The Sakura board can be programmed on the fly and code generated using pre-defined functions and code templates.

As previously mentioned there is a thriving community for the Sakura platform found at Renesas Rulz. The Renesas Rulz community is the place to find help, guidance, technical data and demo applications such as a Sakura LOL (Lots of LEDs) driver. Although the Sakura platform has been around for less than a year there are some amazing demos already in existence.

The Arduino ecosystem is an exciting and rapidly expanding area of electronics and embedded computing. Arduino is even heading to space with the ARDUSAT project whose aim is to allow developers to run their code on an Arduino system in low earth orbit to conduct space experiments.

Product Spotlight

Upcoming Events

View all events
Newsletter
Latest global electronics news
© Copyright 2024 Electronic Specifier