Designing A Paintball Gun Chronograph In A Computer Systems Course Incorporating Intel Microprocessors And Picmicro Microcontrollers
Author(s) -
W.C. Dillard
Publication year - 2020
Publication title -
papers on engineering education repository (american society for engineering education)
Language(s) - English
Resource type - Conference proceedings
DOI - 10.18260/1-2--13448
Subject(s) - microcontroller , debugging , computer science , microprocessor , embedded system , assembly language , class (philosophy) , coding (social sciences) , computer hardware , operating system , software engineering , software , statistics , mathematics , artificial intelligence
Most ECE departments teach computer systems using microcontrollers with microtrainers systems. This approach has two deficiencies. First, students must be in the laboratory to debug real-time code and physically connect peripherals, leaving little opportunity for extracurricular experimentation. Second, treating only the microcontroller distances the student from the ubiquitous PC and its standards. A new approach to teaching computer systems and assembly language for sophomore electrical engineering students is being investigated at Auburn University. Due to curriculum restrictions, the sophomore level course has no formal hardware laboratory. From the outset, four issues were addressed: treating PC-related issues via the 8086 microprocessor (our traditional approach), introducing embedded systems with simple microcontrollers, including a project to add a meaningful hardware experience and providing a means for students to inexpensively program their MCU’s at home. We selected the PIC12F675 microcontroller and the PICkit 1 FLASH Start Kit development board from Microchip Technology, Inc. for our microcontroller studies. Teams of students construct, code, debug and test complete design solutions at home and verify their implementation by real-time execution in class. The paintball chronograph project requires hardware and coding for both the PC and PIC12F675, focusing most of the pertinent course material into a single effort. Course assessments show that the chronograph project was very successful and highly motivational. Hardware construction was relatively simple and easy to debug. Conducting field tests with “live ammo” in front of the entire class provided both excitement and extra motivation for the work. Also, the concepts of serial protocols and the PC serial port operation, particularly the importance of transfer timing and MCU clocking, were well appreciated. P ge 991.1 Proceedings of the 2004 American Society for Engineering Education Annual conference & Exposition CopyrightÀ 2004, American Society for engineering Education Microcontrollers vs. Microprocessors Currently, most ECE departments teach computer systems using microcontrollers with microtrainers systems in formal laboratory settings . Compared to a course based entirely on a microprocessor such as the 8086, this approach has obvious advantages for electrical engineering students. A generic list includes: 1. On-chip memory eliminates the need to interface RAM and ROM to data/address buses or decoding hardware. 2. A rich assortment of on-chip peripherals such as ADC, comparators, timers, serial bus interfaces (UART, CAN, IC, etc.) PWM and DAC are available. There is no need for bus interfacing, I/O decoding or for interrupt number transfers. 3. Clocking a microcontroller requires at most a crystal and a few capacitors rather than a clock generator chip. Many microcontrollers have an internal clocking option that eliminates the crystal altogether. 4. A smaller instruction set requires fewer lectures on coding and allows more time for system-level concerns. 5. Since the microcontroller is a complete computing system, all major CPU concepts can be covered. 6. The amount of lab time needed to construct an embedded system design can be much shorter since bus interfacing to peripherals may not be necessary. 7. Given the popularity of microcontrollers in commercial embedded systems, a proper education should include exposure to microcontrollers. All of these features make embedded systems via the microcontroller more attractive to the student. Such a course/laboratory structure, excluding a treatment of microprocessors (particularly the Intel microprocessors and the PC) and holding laboratories at a fixed location, does have deficiencies. 1. Avoiding the Intel processor family distances students from their most familiar point of reference for computing, the ubiquitous PC and its standards. 2. Students must be in the laboratory to debug real-time code, leaving little opportunity for extracurricular experimentation. 3. Unlike PC’s, microcontrollers are not designed specifically to interface to keyboards and monitors. As a result, students have no exposure to DOS and BIOS function calls for keyboard, monitor and port manipulations. Course Evolution at Auburn University At Auburn University, our undergraduate computer systems course was based entirely on the 8086 processor with a dedicated laboratory where interfacing and coding were verified on custom microtrainers. In 1999, the laboratory structure was changed significantly. Course specific laboratories were replaced with four standalone labs – two in the sophomore year and two in the junior year – none of which included any exposure to the 8086 hardware. Coding migrated from the microtrainers to Pentium based PC’s where the only supported P ge 991.2 Proceedings of the 2004 American Society for Engineering Education Annual conference & Exposition CopyrightÀ 2004, American Society for engineering Education hardware was DOS and BIOS function calls to the keyboard and monitor. Although this allowed students to write, debug and verify code in open computer facilities and at home, there was no hardware content that could be consider an “embedded system”. Furthermore, an introduction to microcontrollers was available only as an elective. In spring semester 2002, a new course structure was attempted that added interface experiments to the microprocessor content using the parallel port. These experiments were conducted by teams of 4 to 6 students as homeworks, constructed on breadboards at home and verified in class. A similar approach was used successfully to add hardware content to a digital electronics service course for computer science majors at Auburn University. Although analog-to-digital converters could have been accessed through the PC ports, we felt this approach was too far removed from a true microprocessor-based embedded system approach and limited all experiments to purely digital designs. While the new course reclaimed some hardware exposure, we were still far from an “embedded system” treatment. To rectify the situation, the course was again modified in spring semester 2003 to retain the microprocessor content but include microcontroller architecture, coding and projects. Time constraints meant that the microcontroller had to be relatively simple with a small instruction set and easy to debug and program. The PIC16F72 microcontroller and MPLAB assembler/debugger from Microchip Technology, Inc. were selected for this task. The salient features of each product are listed in Table 1. Borrowing from an industrial application, the spring 2003 semester project was a fan speed monitor with alarm. The PICmicro MCU monitored the speeds of three fans and transmitted the data to the PC via its serial port. 8086-compatible coding displayed the speeds and alarms on the monitor screen. The major difficulty was providing PIC programmers to the student teams. The least expensive solution was the PICSTART Plus Programmer at $200 each. At the end of the semester, each team owned a PIC16F72, fans and assorted IC’s, but they did not own a programmer. Since one of our goals was to leave the students with the capacity to pursue their own embedded system projects, an alternative to the PICSTART Plus was needed. Table 1. Key Features of the PIC16F72 Core Architecture Peripherals 8-bit data bus Three timers Two 8-bit and one 6-bit I/O port 8-bit SA-ADC Harvard bus structure PWM module Orthogonal RAM IC and SSP serial interfaces Direct, indirect and relative addressing Dc – 20 MHz operation 35 instructions No internal clock option During the summer of 2003, Microchip released the PICkit 1 FLASH Start Kit programming and evaluation board, shown in Figure 1. Although the product can program only 4 different microcontollers, a price of only $36.00 made it an adequate replacement for the PICSTART Plus. In fall semester 2003, we migrated to the PICkit and the 8-pin PIC12F675 microcontroller. (Table 2 contains the critical features of each product.) With the PICkit 1 FLASH Start Kit, coding could be done at home or in open laboratories in the MPLAB environment and programming via an USB port to the PICkit board. A collection P ge 991.3 Proceedings of the 2004 American Society for Engineering Education Annual conference & Exposition CopyrightÀ 2004, American Society for engineering Education of LED’s, switches with potentiometers facilitated simple experiments and the PICkit User’s Guide provided programming details and seven coding tutorials. An important feature of the PICkit was the unpopulated serial port communication snapoff board on the right side in Figure 1, which, after population, was used to communicate with a PC. Although the PIC12F675 lacked serial communication modules, coding for a simple halfduplex UART was not difficult. Armed with their own PICkit 1 FLASH Start Kit, each team OWNED a programmer and could execute all phases of their design at home. Figure 1. The PICKIT programmer/evaluation board from Microchip Technology, Inc.. The right side of the board is the unpopulated serial communication circuit. Table 2. Features of the PICkit 1 FLASH Start Kit and the PIC12F675 Microcontroller PICKIT PIC12F675 Programs 4 different PIC OCU’s Internal 4 MHz clock Compatible with MPLAB 8 pins Self powered from USB 10-bit ADC Unpopulated serial comm. circuit 35 instructions Mutiplexed LED’s Configurable comparator Pushbutton EEPROM Potentiometer One 8-bit timer External access to all oC pins One 16-bit timer User’s guide with 7 coding tutorials 6 programmable I/O The Paintball Chronograph Project For fall semester 2003, a paintball chronograph was chosen for the semester project. A chronograph measures the muzzle velocity of the paintball, usually between 100 and 500 fps, as it exits the barrel of the marker (paintball guns are called markers). Unlike rifles, marker muzzle velocities are adjustable for safe play in
Accelerating Research
Robert Robinson Avenue,
Oxford Science Park, Oxford
OX4 4GP, United Kingdom
Address
John Eccles HouseRobert Robinson Avenue,
Oxford Science Park, Oxford
OX4 4GP, United Kingdom