230 likes | 435 Views
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.
E N D
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 Website with code examples C/C++ Cloud Compiler High-level Peripheral APIs DIP Prototyping Form-Factor
ARM mbed microcontroller module • 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
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
Easy to extend it to store lots of data • 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 GND MISO – p6 SCL - p7 Vcc MOSI – p5 nCS - p8
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
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
“Internet of Things” Student Projects • 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
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 Data 1-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