8-Bit PIC18 Microcontroller Units A Technology Review By: Michael Aeberhard ECE 4007 Senior Design Dr. James Hamblen
Introduction Embedded microcontrollers are a widely used technology in nearly all modern devices. Fewer electrical devices today are controlled by analog means and opt to instead operate digitally using microcontrollers that can be programmed to perform any number of tasks. There are number of different types of microcontrollers for many different types of applications. The most familiar to the common person are the Intel processors that run a typical desktop computer; however, this paper focuses on the much smaller scale and more single-task oriented microcontrollers that operate devices such as a microwave, a radiator fan on a car, or servo motors used to move the handles on a foosball table. One of the more popular and easier to use line of microcontroller products for such taskoriented applications are the 8-bit PIC18 microcontrollers from Microchip, whom in 2006 have been ranked first in world-wide sales of 8-bit microcontrollers [1]. These MCUs (Microcontroller Units) offer a great price/performance ratio and use technology that has been proven to be very reliable and easy to develop with [2]. Overview of the PIC18 Family of Microcontrollers The PIC18 family of MCUs from Microchip are some of the fastest and most featureloaded 8-bit PIC MCUs on the market, with a maximum clock speed of 40 MHz and 128 kb of Flash memory [2]. These microcontrollers are small enough for many embedded applications, but also powerful enough to allow a lot of complexity and freedom in the design process of an embedded system. Microchip Technology makes it easy to begin developing with their PIC18 MCUs through their various development tools and demonstrations boards [3]. The MPLAB Integrated Development Environment allows for a centralized interface between the programmer and all of Microchip Technology s devices. The MPLAB ICD 2 In-Circuit Debugger is the developer s most powerful and cost-efficient tool for low-cost real-time debugging of all PIC18 MCUs. The PIC18 MCUs are programmed using a device-specific PIC assembly language, but using the MPLAB C18 compiler allows developers also to develop applications in C [3]. Depending on the features necessary in the embedded design, various demonstration boards are offered by Microchip Technology that allow developers to realize and test
their designs in a cost-effective manner before producing the final PCB for implementation. Features of the PIC18 The typical PIC18 MCU is feature-loaded with every I/O pin connected to an internal peripheral device. Typical features include 8- and 16-bit timer modules with various features, capture/compare/pwm modules, master synchronous serial port module, universal synchronous receiver and transmitter, 10-bit analog-to-digital converter, comparator, and more [4]. All of these PIC18-wide features can be turned on or off in the program code. The I/O pins that these features run on can be alternatively be used as standard input/outputs in the design if the specific feature to those pins is not used. In addition to these common features, many of the PIC18 MCUs have other device-specific features built into them depending if the design calls for a particular type of technology. Some of the more design-specific features include [2]: Motor Control PWMs Full Speed USB 2.0 PSP Onboard LCD Controller CAN 2.0B PSP 10 Base-T Ethernet Given these wide-array of features, a PIC18 microcontroller is a cost-effective solution to all kinds of embedded design projects. PIC18 Applications The PIC18 MCUs are widely used in everyday modern devices because of their cost and ease of development. One of the most prominent industries that make use of the PIC family of microcontrollers is the automotive industry, where PIC MCUs are used in every aspect of automotive electronics from ABS and airbags to suspension and powertrain [5]. PIC MCUs are ideal for automotive applications because of their low-cost, reliability, ease of development, and features. Controlling external devices such as motors, LCDs,
sensors, etc. are also easily accomplished with designs implemented using the PIC18 MCUs. A high-performance motor controller that makes use of a PIC18 s on-board USB feature to communicate with a laptop for complex algorithm processing and to communicate with a more complex PIC motor controller is demonstrated by Daniel Ramirez in an article in Circuit Cellar [6]. In this article, Daniel shows how easy it is to use design complex embedded motor controller using basic PIC18 technology for device communication and processing. The PIC18 family of MCUs also find their way into the classroom as one of the premier methods of teaching embedded design. The simple instruction set, easy-to-use development tools and demonstration boards, and wide range of features make the PIC18 MCUs a popular choice among professors in universities around the world for teaching embedded design with interesting hands-on projects for students. Professor John Peatman at the Georgia Institute of Technology teaches such a course using the PIC18F452 in conjunction with his text book, Embedded Design with the PIC18F452 Microcontroller, and a handful of projects that make the class interesting and valuable for undergraduate students beginning embedded design [7]. Given the performance and features of the PIC18 MCUs, the range of applications are only limited by the embedded designers who choose to use them. Conclusion Given the high versatility of the PIC18 family of MCUs, Team FIFA has chosen a PIC18F4520 as their primary microcontroller unit for controlling a series of servo motors that will move the handles back and forth on a foosball table and rotate the handles to kick the ball. By receiving commands from a computer, the microcontroller is tasked with reliability and quickly responding to the commands so that a successful robot-player in foosball can be created to achieve victory of a human opponent. Project Members: Team FIFA Michael Aeberhard, gtg039g@mail.gatech.edu (author) Shane Connelly, gtg381r@mail.gatech.edu Evan Tarr, etarr@gatech.edu Nardis Walker, nwalker3@gatech.edu
References [1] Microchip Ranks First in 8-bit Microcontroller Revenue, EDA Geek, [Online document], 2007 Apr. 16, [cited 2007 Sept. 3], Available HTTP: http://edageek.com/2007/04/16/microchip-gartner-dataquest/ [2] Microchip Technology, 2006 Product Line Card, [Online document], Mar 2006, [cited 2007 Sept. 3], Available HTTP: http://ww1.microchip.com/downloads/en/market_communication/00890c.pdf [3] Microchip Technology, PIC18F Development Tools, [Online document], Dec 2006, [cited 2007 Sept. 3], Available HTTP: http://ww1.microchip.com/downloads/en/devicedoc/39673c.pdf [4] Microchip Technology, PIC18F2420/2520/4420/4520 Data Sheet, [Online Document], 2007 June 25, [cited 2007 Sept 3], Available HTTP: http://ww1.microchip.com/downloads/en/devicedoc/39631d.pdf [5] Microchip Technology, Embedded Controller Solutions for Demanding Automotive Applications, [Online document], Oct. 2004, [cited 2007 Sept. 3], Available HTTP: http://www.microchip.com/stellent/groups/sitecomm_sg/documents/devicedoc/en 021613.pdf [6] D. Ramirez, High-Performance Motor Controller, Circuit Cellar, Sept., p.26-28, 2007. [7] J. Peatman, Embedded Design with the PIC18F452 Microcontroller. Upper Saddle River, NJ: Pearson Education, Inc., 2003.