Friday, 09 December 2016 18:29

LOGGING DATA INTO CLOUD USING A FREEDOM BOARD Featured

Written by
Rate this item
(1 Vote)

LOGGING DATA INTO CLOUD USING A FREEDOM BOARD
Student Name
Course Title
Instructor
Date Submitted

Introduction
The mbed rapid prototyping environment and the platform are for the microcontrollers. The environment is a cloud-based IDE and the NXP LPC1768 development board. Over the last several years, the mbed platform has seen extensive growth and development. However, the hardware side of things has not had such growth. This was not good news since the matching development boards usually cost less. This could be one of the reasons why the mbed did not gain popularity like other rapid development platforms. Now there is another powerful board to be used alongside the mbed, the Freescale FRDM-KL25Z which is a move towards the right direction for the Freescale and mbed. The platform allows users to access dirt-cheap development boards and user-friendly IDE.
What is mbed?
mbed is an online development platform and the environment. mbed is also similar to cloud computing services like Google Docs and Zoho Office. However, mbed environment has some advantages and disadvantages. The main advantage is there is no need of installing software on the PC. As long as the user has a web browser and a USB port, they can start using mbed environment. In addition, the new libraries and the IDE updates are handled by the server. Therefore, the user does not have to worry about updating the mbed environment. The online environment can closely monitor while updating the MCU firmware when required. However, the environment is disadvantageous in that the user cannot work with their code off-line. Additionally, it has privacy issues (Boxall, 2013).

Figure 1: mbed environment
It can be seen from the above diagram that the IDE is straight-forward. All the user’s projects can be retrieved from the left column while the editor in the main window, compiler, and other messages are in the bottom window. It also has an online support forum, an official library, and library database. It also has help files among many other components. Therefore, it has plenty of support. It writes code in C/C++, and it does not have any major challenges. When the code is being run, the online compiler creates a binary file which can be downloaded easily and subsequently copied to the hardware through the USB (Marao, 2015).

Freedom Board
A Freedom board is a cheap development board which is based on the Freescale ARM Cortex – M0+ MKL25Z128VLK4. It has the following features (Styger, 2014):
i. Easy access to the MCU I/O
ii. MKL25Z128VLK4 MCU – 48 MHz, 128 KB Flash, 16 KB SRAM, USB OTG (FS), 80LQFP
iii. It has Capacitive touch “slider” MMA8451Q accelerometer; tri-color LED
iv. It has a complex OpenSDA debug interface
v. It has a default mass storage device storage programming interface. Additionally, it does not require any tools for installation in evaluating demo apps
vi. Freedom board’s P&E Multilink interface provides the required run-control debugging as well as compatibility with the IDE tools
vii. Freedom board’s open-source data logging applications provide what can be said to be customer, partner, and development on the OpenSDA circuit.

Figure 2: Freedom Board
Most of the literature on the board, it is mentioned to be “Arduino compatible.” Being Arduino compatible is because of the layout of the GPIO pins. Therefore, if a user has a 3.3 V-compatible Arduino shield, they may be in a position to use it. However, the I/O pins are able only to sink or source a 3 mA so GPIO should be handled with care. However, as can be seen from the features, Freedom Board has an accelerometer as well as an RGB LED which can be used for various uses (Sunny IUT, 2015).
Getting Started
This explains the process through which a Freedom board is put into working with mbed as well as creating first program (Hello world). The requirements are a computer installed with any operating system (OS) with USB, connection to the Internet, and a web browser. Additionally, there is a need for a USB cable (mini-A to A) and lastly a Freedom board. Here is the procedure:
i. Ensure the Freedom board is there
ii. Download and install the required USB drivers for any operating systems preferably Windows and Linux
iii. Create a user account at mbed.org by strictly following the instructions given
iv. Plug in the Freedom board by use of USB socket labeled OpenSDA. After plugging the Freedom board, it is going to appear as a disk referred to as “bootloader.”
Among the following steps, plugging in the Freedom board, getting software, building and running, and creating are the most important. Choosing the software is selecting the development path. The user chooses between Kinetis Software Development Kit (SDK) + Integrated Development Environment (IDE) and ARM mbed Online Development Site (Styger, 2014).
Features of SDK+IDE
i. It has the ultimate flexibility of the software
ii. It has examples of application and project files
iii. It has a true support of debugging through the SWD and JTAG
iv. It has all the peripheral drivers with their source
Features of ARM mbed Online Development Site
i. It has an online compiler but lacks SWD, and/or JTAG debug
ii. It has heavily abstracted and simply built programming interface
iii. Although it is useful, its drivers are limited with a source
iv. It has examples submitted by the community
Build and Run SDK demonstrations on the FRDM-KL25Z
i. Exploring the SDK Example Code
The Kinetis SDK has an inbuilt long list of applications for demo as well as examples of drivers.
ii. Build, Run, and Debug the SDK examples
This is step-by-step instructions on the user can easily configure, build, and debug the demos for the toolchains easily supported by the SDK
Creating Applications for the FRDM-KL25Z
i. Getting the SDK Project Generator
This explains the creation of the project and making of a simple SDK-based application. Using the NXP, the users will be provided with intuitive, simple project generation utility thus allowing easy creation of custom projects according to the Kinetis SDK
ii. Running the SDK Project Generator
After the extraction of the ZIP file, the utility is opened by a simple click on the KSDK_Project_Generator executable for the computer’s operating system. Then the board used as a reference is selected.

Figure 3: KSDK Project Generator
Open the Project
The new project will be retrieved from <SDK_Install_Directory>/examples/frdmkl25z/user_apps. The project is opened on the toolchain
iv. Writing Code
Writing code is making a new project which is functional other than spinning in an infinite loop. The examples of the SDK have a board support package (BSP) to help in doing different things to the Freedom board. This includes macros and clear definition of the terms like LED, peripheral instances, and switches among others. Below is a LED blink made using the BSP macros
The main()function in the code’s main.c should be updated using the piece of code below:
volatile int delay;
//Configure board specific pin muxing
hardware_init();
//Initialize the UART terminal
dbg_uart_init();
PRINTF (“\r\nRunning the myProject project.\n”);
//Enable GPIO port for LED1
LED1_EN;
For (;;)
{
LED1_ON;
delay = 5000000;
while(delay--);
LED1_OFF;
delay = 5000000;
while(delay--); }
The above code is then uploaded to the Freedom board after the IDE is entered by clicking “Compiler”
Creating the Uploading Code
A simple program is created to ensure all is well. When the IDE is entered, it presents the user with “Guide to mbed Online Compiler.” The user then clicks “New” after which the program is given a name and click Ok. The user is then presented with a basic “hello world” program blinking the blue LED within the RGB module. The delays are then adjusted according to the likings of the users after he clicks “Compile” in the toolbar. Assuming everything has gone well, the web browser will present the user with a .bin file downloaded to the default download directory. The .bin file is then copied to the mbed drive and reset button is pressed on the Freedom board. The blue LED now starts blinking (Meikle, 2015).
Moving Forward
There are some examples of code demonstrating how accelerometer, RGB LED, and touch are used. The map below shows the pins on the Freedom board with regard to the mbed IDE

Figure 4: Freedom Board Pins
All the blue pins such as PTxx can easily be referenced in the code. For instance, pulsing PTA13 on and off after every second, the code below is used (Young, 2015):
include “mbed.h”
digitalOut pulsepin(PTA13);
int main() {
while(1){
pulsepin = 1;
wait(1);
pulsepin = 0;
wait(1);
}
}
The pin in the reference will be inserted within the DigitalOut assignment. Therefore, “pulsepin” refers to the PTA13.
CONCLUSION
The Freedom board offers users a very cheap way of getting into the programming and microcontrollers and finally into the cloud. Users should not be worried by the IDE or the revisions of firmware. Additionally, they should not be worried by the installation of the software on the locked-down computers or the fact that they might lose the files. The paper has shown that it is indeed to use Freedom boards to easily log into the cloud which enables the data to be accessed.

Works Cited
Boxall, J. (2013). mbed and the Freescale FRDM-KL25Z development board. Retrieved from Tronixstuff: http://tronixstuff.com/2013/03/07/mbed-and-the-freescale-frdm-kl25z- development-board/
IUT, S. (2015). Freescale freedom FRDM-K64F development platform. Retrieved from Element 14 Community: https://www.element14.com/community/roadTestReviews/1972/l/freescale-freedom- frdm-k64f-development-platform-review
Marao, B. (2015). Freedom beginners guide. Retrieved from Element 14 Community: https://www.element14.com/community/docs/DOC-68209/l/read-me-first-freedom- beginners-guide
Meikle, C. (2015). Freescale Freedom FRDM-K64F development platform. Retrieved from Element 14 Community: https://www.element14.com/community/roadTestReviews/1984/l/freescale-freedom- frdm-k64f-development-platform-review
Styger, E. (2014). Freedom board with Adafruit ultimate GPS data logger shield. Retrieved from DZone: https://dzone.com/articles/tutorial-freedom-board
Styger, E. (2014). IoT datalogger with ESP8266 Wi-Fi module and FRDM-KL25Z. Retrieved from MCU on Eclipse: https://mcuoneclipse.com/2014/12/14/tutorial-iot-datalogger- with-esp8266-wifi-module-and-frdm-kl25z/
Young, D. (2015). Create your own cloud server on the Raspberry Pi 2. Retrieved from Element 14 Community: https://www.element14.com/community/community/raspberry- pi/raspberrypi_projects/blog/2015/05/05/owncloud-v8-server-on-raspberry-pi-2-create- your-own-dropbox
https://developer.mbed.org/platforms/FRDM-K64F/#flash-a-project-binary
https://developer.mbed.org/platforms/IBMEthernetKit/

Read 730 times

Leave a comment

Make sure you enter all the required information, indicated by an asterisk (*). HTML code is not allowed.

2014 LOGGING DATA INTO CLOUD USING A FREEDOM BOARD.
Powered by Joomla 1.7 Templates
Trusted Site Seal Comodo SSL Certificate SSL