Project Guide
User Manual: Pdf
Open the PDF directly: View PDF
.
Page Count: 4

PROJECT #1 GUIDE
UCB ECEN 5803 FALL 2017 PROJECT #1: FREESCALE MBED AND KEIL
TABLE OF CONTENTS
Introduction - mbed ...................................................................................................................................................... 1
Software Development Kit (SDK) ........................................................................................................................... 1
Hardware Development Kit (HDK) ......................................................................................................................... 2
Free Online Development Tools ............................................................................................................................ 2
Worldwide Developer Community ........................................................................................................................ 3
Have Fun! ............................................................................................................................................................... 3
I. Module 1: Assembly Arithmetic ........................................................................................................................... 3
II. Module 2: Feel the Vibrations .............................................................................................................................. 4
III. Module 3: Serial PORT DEBUG MONITOR ........................................................................................................ 4
IV. Module 4: BARE METAL FLowMeter Simulation .............................................................................................. 4
INTRODUCTION - MBED
The mbed platform provides free software libraries, hardware designs and online tools for professional rapid
prototyping of products based on ARM microcontrollers.
The platform includes a standards-based C/C++ SDK, a microcontroller HDK and supported development boards,
an online compiler and online developer collaboration tools.
SOFTWARE DEVELOPMENT KIT (SDK)
The mbed Software Development Kit (SDK) is an open source C/C++ microcontroller software platform relied upon
by tens of thousands of developers to build projects fast. We've worried about creating and testing startup code, C
runtime, libraries and peripheral APIs, so you can worry about coding the smarts of your next product.
The SDK is licensed under the permissive Apache 2.0 license, so you can use it in both commercial and personal
projects with confidence.
The mbed SDK has been designed to provide enough hardware abstraction to be intuitive and concise, yet
powerful enough to build complex projects. It is built on the low-level ARM CMSIS APIs, allowing you to code down
to the metal if needed. In addition to USB and Networking libraries, a cookbook of hundreds of reusable peripheral
and module libraries have been built on top of the SDK by the mbed Developer Community.

Page 2 of 4
mbed SDK
HARDWARE DEVELOPMENT KIT (HDK)
The mbed Hardware Development Kit (HDK) provides full microcontroller sub-system design files and firmware for
building development boards and custom products that benefit from the native support of the mbed SDK and free
mbed Online Compiler and mbed Developer Platform.
The HDK specifies all support components and circuits including the mbed Onboard Interface design that provides
simple USB drag-n-drop programming and CMSIS-DAP debug interface for the target microcontroller.
Development boards that are already based on the HDK are the quickest way to get started with the mbed
platform. We manufacture official mbed Microcontroller modules that are specifically optimized for flexible rapid
prototyping, and are available from distributors worldwide. Our partners are now also creating mbed-enabled
hardware such as ultra-low-cost ARM evaluation boards in the popular Arduino form-factor.
mbed HDK
mbed Hardware
FREE ONLINE DEVELOPMENT TOOLS
The mbed Compiler is a powerful online IDE that is free for use with hardware implementing the mbed HDK, and
tightly integrated with the mbed SDK and Developer Website. Under the hood, it relies on the industry standard
ARM professional C/C++ compiler, pre-configured and tested to generate fast, efficient code without fuss.
Login anywhere to get instant access to your development environment, on Windows, Mac, Linux. You can even
work from tablets!
Whilst the mbed Compiler provides you your own private workspace, it is also fully integrated with the mbed.org
Developer Website so you can easily import libraries and examples. If you choose to, publishing your own code

Page 3 of 4
and collaborating with other mbed users is just a few clicks too. The mbed Compiler also supports full export to
different toolchains, in case your project demands it as you go to production.
mbed Compiler
Collaboration
Export
WORLDWIDE DEVELOPER COMMUNITY
Using mbed means a huge shared context with other developers, and that means when you have a question, there
is less pre-amble, less explanation and less time reproducing issues, and more time getting answers. We're proud
that this has helped us grow an active and friendly community of skilled developers that are collectively helping get
prototypes made even faster.
But where it really gets interesting is with code. Our developers are sharing thousands of open source repositories
and building an extensive cookbook of recipes that you can reuse to build your products.
We've also made contributing back is easy; you can publish a library to mbed.org with a few clicks in the IDE, and
let others build on your hard work. In fact, this is how some of our users end up collaborating on hard problems,
and even getting contract work.
HAVE FUN!
I. MODULE 1: ASSEMBLY ARITHMETIC
1. From D2L, download the word document Lab_Exercise_2.docx and Code2.zip.
2. Follow the Lab_Exercise_2 directions.
3. Test your code with these inputs: 2, 4, 22, and 121. Record the results.
4. Estimate the number of CPU cycles used for this calculation.
5. Auto-generate documentation using Doxygen. Provide either an HTML directory or PDF file documenting your
codebase.

Page 4 of 4
II. MODULE 2: FEEL THE VIBRATIONS
1. Create a program to more fully evaluate the Freescale Kinetis KL25Z MCU for use in a Flowmeter:
a. Write a program either using the mbed compiler, or in the Keil MDK, to read the accelerometer to sense
vibration
b. Use the “vibration” values to drive a control output. In this case, make the color of the RGB LED change
with respect to movement of the board
c. Read the output from the capacitive touch slider, and use it to dim the LED
2. Estimate the processor load in % of CPU cycles
3. Auto-generate documentation using Doxygen. Provide either an HTML directory or PDF file documenting your
codebase.
--------------------------------------------------------------------------------------------------------------------------------------------------------
III. MODULE 3: SERIAL PORT DEBUG MONITOR
1. From D2L, download the word document Project1_Module3.docx and Code3.zip
2. Follow the directions given in the Project1_Module3.docx
3. Add a command to the monitor. Capture a screenshot of the new monitor window.
4. Estimate the % of CPU cycles used for this process, assuming a 100 millisecond operating cycle.
5. As a separate project, run either the Dhrystone or the Whetstone benchmark program on your target
processor. If running the Dhrystone, calculate the number of VAX DMIPS.
6. Auto-generate documentation using Doxygen. Provide either an HTML directory or PDF file documenting your
codebase.
IV. MODULE 4: BARE METAL FLOWMETER SIMULATION
1. From D2L, download the word document Project1_Module4.docx and Code4.zip.
2. Follow the directions in the Project1_Module4.docx.
3. Once you have completed the code to calculate the volumetric flow, request the simulated ADC data file
from your instructor. Each project team data file will be different.
4. Record the reported values of frequency and flow from your monitor program.
5. Estimate the % of CPU cycles used for this process, assuming a 100 millisecond operating cycle.
6. Calculate the power consumption for your complete system (including proposed hardware additions)
when in full run mode, and again in low power mode. Include detailed timing assumptions used in each
mode.
7. Auto-generate documentation using Doxygen. Provide either an HTML directory or PDF file documenting
your codebase.