using a web 2.0 approach for embedded microcontroller systems

23
Using a Web 2.0 Approach for Embedded Microcontroller Systems J. O. Hamblen and G. M. E. Van Bekkum School of Electrical and Computer Engineering, Georgia Institute of Technology, Atlanta, Georgia, USA

Upload: inocencia-quesada

Post on 31-Dec-2015

35 views

Category:

Documents


1 download

DESCRIPTION

Using a Web 2.0 Approach for Embedded Microcontroller Systems J. O. Hamblen and G. M. E. Van Bekkum School of Electrical and Computer Engineering, Georgia Institute of Technology, Atlanta, Georgia, USA. Microcontroller-based Embedded Systems Courses. - PowerPoint PPT Presentation

TRANSCRIPT

Using a Web 2.0 Approach for Embedded Microcontroller Systems

J. O. Hamblen and G. M. E. Van BekkumSchool of Electrical and Computer Engineering, Georgia Institute of Technology, Atlanta, Georgia, USA

Microcontroller-based Embedded Systems Courses

• Similar undergraduate courses can be found at many schools (including EE, CmpE, and CS)

• Most new design activity is now focused on 32-bit devices• C/C++ remains the most widely used language in industry• Networking support is often needed – “Internet of Things”• Many hard adoption choices to make initially:

– Textbooks– Microcontroller– Tool chain– Development board– Sensors and I/O Devices– Software Support Infrastructure (Drivers and Code Examples)

ARM’s mbed Rapid Prototyping Platform• Hardware & Software, using a Web 2.0 Solution

C/C++ Cloud Compiler

DIP Prototyping Form-Factor

Website with code examples

High-level Peripheral APIs

• ARM 32-bit Cortex-M3 MCU in a Prototyping Form-Factor– 0.1” pitch 40-pin DIP module with “USB Flash Drive” interface to PC– Nothing to install or configure, practical for breadboard and PCBs– Powered from USB cable, battery, or external power supply– Module cost is about half the price of a current college textbook– Free accounts for students in a class via email

ARM mbed microcontroller module

Microcontroller Hardware Features

• NXP1768 32-bit ARM Cortex-M3 SOC running at 96MHz• 512KB FLASH and 64KB RAM on-chip• Ethernet, USB, CAN, SPI, I2C, Serial, PWM, ADC, and DAC I/O interfaces are all on-chip

• A final system might want to store lots of data• Hardware for an SD Card is minimal

– SPI Port connection using simple breakout– Only 4 wires & power needed– File system code provided– Can also use a USB flash drive

GNDMISO – p6SCL - p7VccMOSI – p5nCS - p8

Easy to extend it to store lots of data

Baseboard or Breadboard?

•A baseboard contains the common I/O connectors and a small prototyping area, so for basic labs there is nothing to wire up.

•A breadboard will require wiring some connections, but is more flexible for custom hardware designs and design projects. Most external I/O devices are serial (i.e., Ethernet, USB, SPI, I2C, RS232) and will only need a few jumper wires.

Breakout Boards for Student Breadboards

• Breakout Boards make it easy for students to use modern surface mount devices on a breadboard– Low-cost, preassembled, and commercially available– Wide selection of devices for the new large hobbyist market

Popular Breakout Boards for Student Projects

Purpose Sensor or Device Interface, IC, and commentsDisplay ASCII text B&W Text LCD Display Parallel Digital - HD44780Display text and graphics Color LCD graphics display SPI – Nokia 6100 128x128VGA display on a monitor VGA controller TTL Serial – PICASO-SGCAdd digital audio output MP3/AAC/WMA decoder SPI - VLSI VS1033Touch switch or keypad Touchpad controller I2C – Freescale MPR121Measure motion or orientation MEMS Gyro & Accelerometer I2C – ITG322 & ADXL345Measure environmental data Temperature & Humidity Serial - Sensirion SHT15Location and speed GPS receiver RS232 Serial NEMA - variousDirection Electronic Compass I2C - Honeywell HMC6352Measure Distance IR reflection Analog or Digital - Sharp GP2xxUltrasonic Range Sonar (longer range than IR) Analog or Serial - MaxSonar XL EZxCell phone network for data Cell Phone modem module RS232 Serial, need SIM - various Wireless data transmission Zigbee/XBee Serial – Digi XBee XBPxxDisplays 230 colors on LED RGB LED & driver SPI - Allegro A6281 on ShiftBriteUse PWM to drive DC motors H-bridge driver PWM – STMicro VNH3SP30Add networking MagJack connector EthernetConnect to a serial port RS232 level convertor RS232 Serial - variousAdd USB thumb drive USB A connector USB – variousAdd flash file system Micro SD card connector SPI – variousAdd mouse and/or keyboard PS/2 connector PS/2 serial protocol

Web 2.0 Tools• Dedicated Developer Web Platform

– Custom Web 2.0 tools and Cloud Compiler– User “Forum”, API Documentation in “Handbook” – Wiki Code Examples in “Cookbook”

Cloud Compiler• Cloud-Based C/C++ Compiler

– Web 2.0 browser-based IDE with personal file space “in the cloud”– Nothing to install or configure, login from anywhere– Based on the Keil Tools C/C++ compiler widely used in industry– Javascript (AJAX) based environment for compiling code– Only two mouse clicks to compile and download flash to run code

mbed I/O API Library• High-level I/O Peripheral APIs

– Trades a bit of memory and CPU performance for ease of use– Abstract software interfaces for controlling microcontroller hardware– Intuitive peripheral access, encapsulation of implementation details – Treat hardware and software the same– Online “Handbook” with documentation & code examples for all APIs

Cookbook Wiki

• User contributed code examples and hardware designs• Easy to import libraries and projects via web• Support for networking, displays, and many different

types of sensors and I/O devices

Debug Support• No hardware breakpoints!

– Would be nice, but can live without it given the other advantages– Not as big a drawback as we expected– Can also emulate small code segments using free Keil Tools offline

• Four onboard easy to use user LEDs– LEDs will also flash on a run time error

• printf() prints over USB to any PC Terminal Emulator Program– module works like a USB Virtual COM Port

Student Design Projects• Teams of two students with two weeks for mini design project• Design project comes after two introductory labs

“Internet of Things” Student Projects• An internet enabled clock that syncs to a time server• Text LCD and network magjack breakout boards• Based on LCD and network drivers from the Cookbook

• An internet radio receiver• MP3 decoder chip, audio jack, network jack, and USB flash

driver breakout boards• MP3 and network drivers adapted from Cookbook examples

“Internet of Things” Student Projects

• Universal Translator• MP3 decoder chip, Text LCD, audio jack, network jack, PS/2

jack, and Micro SD Card breakout boards• Uses Google’s Internet APIs for translation and speech

“Internet of Things” Student Projects

Graphics and Games• Classic Pong Game• Nokia Cell Phone 130 by 130 Color LCD breakout board• Small low-cost VGA breakout boards are also available• Graphics driver used from Cookbook

Control Systems• A self-balancing two wheel robot using two low-cost geared

DC motors with a built-in quadrature encoder feedback• H-bridge MOSFET driver, MEMs Gyro and Accelerometer

breakout boards• Uses PWM for motor control, MEMs IMU, and a PID control

loop - all from Cookbook code examples

Assessment Data1-strongly disagree … 3-Neutral … 5-strongly agree

• I think the experience with labs that used breadboards with breakout boards was worthwhile. - 4.4

• I would prefer labs where everything was already connected on a circuit board even though I might have somewhat less flexibility to do different things on projects. - 1.87

• I would prefer an mbed design project rather than a third traditional lab assignment for mbed. – 4.0

• I would prefer the “cloud compiler” web browser approach versus a more traditional development tool that was only available for use on the laboratory PCs. (Assuming they have the same features) - 3.6

• I would prefer electronic copies of course materials versus traditional printed course materials and printed textbooks. (Assuming content and cost are about the same) - 3.8

• I prefer a team design project with presentations over a more traditional final exam. - 4.86

Conclusions

• There is some value in returning to a Student Breadboard approach for embedded systems labs

• The cloud compiler approach works well for student labs and greatly reduces the computer support issues

• Higher-level I/O support APIs work well for the new generation of microcontrollers and save development time

• Networking is needed in these courses and leads to more interesting “Internet of Things” design project options

• For such a course, having the all of the resources online may be a better option than printed textbooks and lab manuals. Students now appear to prefer online electronic copies.

References[1] M. Barr, “Real men program in C”, Embedded Systems Design, 2009 [Online]. Available:

http://www.embedded-systems.com/design/218600142 [2] ECE 4180 Embedded Systems Design [Online] Available: http://www.ece.gatech.edu/~hamblen/4180 [3] Ashlee Vance, “You Too Can Join the Internet Of Things”, New York Times, September 20, 2010.

Available: http://bits.blogs.nytimes.com/2010/09/20/you-too-can-join-the-internet-of-things/ [4] S. Ford, Rapid Prototyping for Microcontrollers,[Online]. Available:

http://mbed.org/media/press/mbed_whitepaper.pdf [5] ARM University Program [Online]. Available: http://www.arm.com/support/university/ [6] J. Hamblen, “IC Sensor and Driver Breakout Boards” [Online]. Available:

http://mbed.org/cookbook/IC-Sensor-and-Driver-Breakout-Boards [7] Mbed Cookbook Wiki [Online]. Available: http://mbed.org/cookbook/Homepage [8] Mbed Educational Program [Online]. Available: http://mbed.org/handbook/Education [9] Mbed Handbook [Online]. Available: http://mbed.org/handbook/Homepage [10] Mbed Forum [Online]. Available: http://mbed.org/forum/ [11] J. Hamblen, “Mbed Student Projects”, 2011 [Online]. Available:

http://mbed.org/cookbook/Student-Projects