11
Abstract—In this paper, we present a bunch of experiments useful for an embedded system laboratory. It is an outcome of the author’s experience in teaching computer architecture and embedded systems in theory. The experiments described herein can be implemented as one third semester laboratory course. Further, they are built around the Texas Instrument’s low-power RISC microcontroller MSP430F149, which supports modular programming. The components including the microcontroller with programmer are inexpensive. It gives a hands-on experience to the undergraduate student of electronics and communication engineering (ECE) and computer science engineering (CSE). The salient feature of this module is that each experiment is explained by its hardware description, software development which includes the dumping of program on to the microcontroller’s flash memory. Program listing is made available on request. The compiler necessary for program development is available as freeware from Texas instrument’s website. It can be used to develop 4kB of program which is fairly sufficient for the experiments described herein. Our experience with the conduct of a 120 min-end of semester practical examination show that, with the chronological increase in hardware design, the student exhibited the confidence in designing new stand-alone systems with fairly complicated hardware and software. Setting up a laboratory of this type is easy with the material described in this paper Index Terms— Embedded system laboratory, Low power microcontroller, MSP430F149, Stand-alone system, Take-home experiments. I. INTRODUCTION The impact and presence of embedded systems is felt directly in our daily walk of life. Starting with cellular phones, digital cameras, home appliances space applications, up to the ubiquitous networking and sensor networking, embedded systems are used [1]. Applications of embedded systems are increasing exponentially and is pervading in to the U.Naveen Kumar is a Junior Research Student in the VLSI and Embedded System Laboratory, , Department of Physics, Sri Krishnadevaraya University, Anantapur, A.P., INDIA, 515003; (e-mail: naveeneimc2@ gmail.com.) 1 Corresponding Author: K.Raghavendra Rao is Professor and Chairman, Board of Studies in Physics, Department of Physics, Sri Krishnadevaraya University, Anantapur, A.P. INDIA, 515003;+91-9440204722 ;(e-mail: [email protected] ). various branches of science and technology. Further, the development of low-power mixed signal controllers from various manufacturers, particularly from Texas Instruments, U.S.A., has paved path for the percolation of embedded systems in to industrial, automobile, agricultural and robotic environments. In global scenario, embedded system courses are introduced in to existing science and engineering curricula [2,3]. Presently, in majority of Indian Universities, embedded system is included in the curriculum at the under-graduate level of Science and Engineering with electronics as major. Diploma and Certificate courses are also run in this direction. Topics such as Computer Architecture, Operating Systems, Microcontrollers, Design of Embedded Systems, and Interfacing Applications etc. are taught in theory. When it comes to the Laboratory, the kind of exposure and training the student gets is meager. In certain cases, demo experiments were introduced. This hinders the practical training the student is expected to get in the Embedded System Training Laboratory. In certain cases, the students are trained with simulation experiments. This type of practical training does not improve the skills on hardware assembling and does not provide hands-on experience. If this is the case, the zeal to learn and the spark of innovation is lost. Further, the student cannot do well in the Industry internships. Existing problems in graduate teaching is well explained [4]. Experiments on embedded system training are continuously monitored and improved basing on the changes taking place in the architecture of microcontrollers. Further, the industry and R&D department needs the new technological design but won’t rely on old ones; since the newer controllers draw less power, occupy less space and provide advanced on-chip features and better code optimization. Training the student at the entry level of embedded system course gives a double benefit besides the theoretical knowledge. It gives a scope to modern teaching practices, international project collaboration and cooperative learning processes [5,6,7]. Keeping these facts in view point, we have developed more than a dozen of interfacing experiments using the Texas Instrument’s low-power mixed signal controller MSP430F149. These experiments will cover one-third of semester. Of course, microcontrollers with advanced architecture are also available. Our aim is to start humbly, with a simple microcontroller and then move to complex architectures. The salient feature of the work is that we have explained all the experiments in stand-alone mode, using microcontroller Design and Development of a Low-Cost Embedded System Laboratory Using TI MSP430F149 Naveen Kumar Uttarkar and Raghavendra Rao Kanchi 978-1-4673-4866-9/13/$31.00 ©2013 IEEE International conference on Communication and Signal Processing, April 3-5, 2013, India 165

[IEEE 2013 International Conference on Communications and Signal Processing (ICCSP) - Melmaruvathur, India (2013.04.3-2013.04.5)] 2013 International Conference on Communication and

Embed Size (px)

Citation preview

Page 1: [IEEE 2013 International Conference on Communications and Signal Processing (ICCSP) - Melmaruvathur, India (2013.04.3-2013.04.5)] 2013 International Conference on Communication and

Abstract—In this paper, we present a bunch of experiments

useful for an embedded system laboratory. It is an outcome of the author’s experience in teaching computer architecture and embedded systems in theory. The experiments described herein can be implemented as one third semester laboratory course. Further, they are built around the Texas Instrument’s low-power RISC microcontroller MSP430F149, which supports modular programming. The components including the microcontroller with programmer are inexpensive. It gives a hands-on experience to the undergraduate student of electronics and communication engineering (ECE) and computer science engineering (CSE). The salient feature of this module is that each experiment is explained by its hardware description, software development which includes the dumping of program on to the microcontroller’s flash memory. Program listing is made available on request. The compiler necessary for program development is available as freeware from Texas instrument’s website. It can be used to develop 4kB of program which is fairly sufficient for the experiments described herein. Our experience with the conduct of a 120 min-end of semester practical examination show that, with the chronological increase in hardware design, the student exhibited the confidence in designing new stand-alone systems with fairly complicated hardware and software. Setting up a laboratory of this type is easy with the material described in this paper

Index Terms— Embedded system laboratory, Low power microcontroller, MSP430F149, Stand-alone system, Take-home experiments.

I. INTRODUCTION The impact and presence of embedded systems is felt directly in our daily walk of life. Starting with cellular phones, digital cameras, home appliances space applications, up to the ubiquitous networking and sensor networking, embedded systems are used [1]. Applications of embedded systems are increasing exponentially and is pervading in to the

U.Naveen Kumar is a Junior Research Student in the VLSI and Embedded

System Laboratory, , Department of Physics, Sri Krishnadevaraya University, Anantapur, A.P., INDIA, 515003; (e-mail: naveeneimc2@ gmail.com.)

1 Corresponding Author: K.Raghavendra Rao is Professor and Chairman, Board of Studies in Physics, Department of Physics, Sri Krishnadevaraya University, Anantapur, A.P. INDIA, 515003;+91-9440204722 ;(e-mail: [email protected]).

various branches of science and technology. Further, the development of low-power mixed signal controllers from various manufacturers, particularly from Texas Instruments, U.S.A., has paved path for the percolation of embedded systems in to industrial, automobile, agricultural and robotic environments. In global scenario, embedded system courses are introduced in to existing science and engineering curricula [2,3]. Presently, in majority of Indian Universities, embedded system is included in the curriculum at the under-graduate level of Science and Engineering with electronics as major. Diploma and Certificate courses are also run in this direction. Topics such as Computer Architecture, Operating Systems, Microcontrollers, Design of Embedded Systems, and Interfacing Applications etc. are taught in theory. When it comes to the Laboratory, the kind of exposure and training the student gets is meager. In certain cases, demo experiments were introduced. This hinders the practical training the student is expected to get in the Embedded System Training Laboratory. In certain cases, the students are trained with simulation experiments. This type of practical training does not improve the skills on hardware assembling and does not provide hands-on experience. If this is the case, the zeal to learn and the spark of innovation is lost. Further, the student cannot do well in the Industry internships. Existing problems in graduate teaching is well explained [4]. Experiments on embedded system training are continuously monitored and improved basing on the changes taking place in the architecture of microcontrollers. Further, the industry and R&D department needs the new technological design but won’t rely on old ones; since the newer controllers draw less power, occupy less space and provide advanced on-chip features and better code optimization. Training the student at the entry level of embedded system course gives a double benefit besides the theoretical knowledge. It gives a scope to modern teaching practices, international project collaboration and cooperative learning processes [5,6,7]. Keeping these facts in view point, we have developed more than a dozen of interfacing experiments using the Texas Instrument’s low-power mixed signal controller MSP430F149. These experiments will cover one-third of semester. Of course, microcontrollers with advanced architecture are also available. Our aim is to start humbly, with a simple microcontroller and then move to complex architectures. The salient feature of the work is that we have explained all the experiments in stand-alone mode, using microcontroller

Design and Development of a Low-Cost Embedded System Laboratory Using

TI MSP430F149

Naveen Kumar Uttarkar and Raghavendra Rao Kanchi

978-1-4673-4866-9/13/$31.00 ©2013 IEEE

International conference on Communication and Signal Processing, April 3-5, 2013, India

165

Page 2: [IEEE 2013 International Conference on Communications and Signal Processing (ICCSP) - Melmaruvathur, India (2013.04.3-2013.04.5)] 2013 International Conference on Communication and

module instead of a microcontroller trainer board consisting of all interfacing components integrated on the board itself. The experiments presented in this paper start with LED interfacing and goes up to the interfacing of sensors and can be extended to sensor networking, using MSP430F149. The systematic approach by learn-while-doing, not only increases confidence in the student, but lights up the spark of innovation by thinking new ways of using the microcontroller. Further, because of the use of low-cost components for interfacing, student can afford to purchase them and hence it will be like a take-home experiments [8]. The set of experiments, described in this paper, can also be useful for an electronics hobbyist having basic knowledge on electronics and to a fresh research student who wants to work in the direction of microcontroller instrumentation. This paper is organized as follows: Section-II gives brief description on the architectural details of MSP430F149 mixed signal controller. The programming procedure of the controller using IAR Work Bench is described in Section-III. Section-IV gives the hardware and software details on the experiments developed in the present study. Conclusions and scope for future work are included in Section-V. II. ARCHITECTURE DESCRIPTION OF MSP430 SERIES MIXED SIGNAL CONTROLLER

The MSP430F149 is a 16-bit mixed signal controller with von Neumann architecture designed for low power applications. It is a RISC processor with the following salient features:

Efficient CPU with a sea of registers Several selectable low-power modes Choice of selecting clock frequency On-chip peripherals: Timers, Analog-to-digital converter, Flash memory, Hardware multiplier, Digital I/O pins, DMA Controller, Comparator, USARTs, Watch Dog Timer.

The internal architecture diagram of MSP430F149 is shown in figure 1. The hardware multiplier is useful for digital signal processing. The register organization in particular helps in code optimization. The 64-pin configuration (QFP) and internal CPU architecture are shown in figure 2 and 3, respectively.

Fig. 1. Architecture of MSP430F149 (courtesy Texas Instruments, USA)

Fig. 2. Pin diagram of MSP430F149 (courtesy Texas Instruments, USA)

This microcontrollers supports modern programming

techniques such as calculated branching, table processing and the use of high-level language such as C. It supports 27 instructions and 7 addressing modes.

Fig. 3. Block diagram of MSP430F149 CPU (Texas Instruments, USA)

Texas Instrument’s user manual gives a detailed description on MSP430. Also, there are a couple of text books available on the market [9, 10]. III. PROGRAMMING PROCEDURE

The MSP430F149 can be programmed using two programming techniques, as given below:

Boot strap loader (using serial interface) Conventional JTAG (four wire connection)

In the present work MSP430F149 is programmed using Flash Emulation Tool (FET). It uses conventional JTAG programming technique to program MSP430F149’s flash memory. IAR embedded workbench kick start Version 5.40 IDE was used for the software development of MSP430. The compiler for this version is freely available from the Texas Instrument’s website [11]. It has a code limit of 4kB. All the

166

Page 3: [IEEE 2013 International Conference on Communications and Signal Processing (ICCSP) - Melmaruvathur, India (2013.04.3-2013.04.5)] 2013 International Conference on Communication and

experiments described here fits within this limit. Brief description of the programming procedure is explained below, in the form of steps. When the program written for a specific purpose is free from bugs, then, the generated hex file is loaded into the flash memory of MSP430F149 using JTAG. Now, the module works on standalone mode. Figure 4 shows the connection between the JTAG programmer and MSP430F149 module.

Fig. 4. Connections for loading program into MSP430F149 using MSP430 FET tool

The following steps describes the program development and execution process for LED_BLINK program as example. After installation of the IAR Workbench software, and before following the steps given below, click on IAR Embedded Workbench Icon from Desktop.

Step1: Click on to Project and select Create New Project in the popup menu. To create a new project, select MSP430 tool chain and select C program template for entering program. Click on OK button.

Fig. 5. Creating a new project window

Step2: Here we type the project file name with an extension of ewp, e.g., LED_BLINK.ewp, and save it on any drive. The screen shot of this is shown below:

Fig. 6. Saving project file name with LED_BLINK.ewp

Step3: Click on File at the left top corner. Click on to New. Space will be created for entering the program. Enter your program and click on to Save. Save your file as LED_BLINK.C. The final screen shot is shown in figure 7.

Fig. 7. Saving C file with LED_BLINK.C

Step4: In this step select the options for project. Here the device MSP430F149 and FET debugger are selected. Below figure (figure 8) shows the selecting procedure. Click on to OK.

Fig. 8. Selecting options for project file

Step5: In this step the workspace is saved with LED_BLINK.eww name. Figure 9 shows this.

Fig. 9. Saving the work space with LED_BLINK.eww name

Step6: In this step F7 is pressed to compile the program and Ctrl + D to make in-system debugging. The screen shot is shown in figure 10.

Fig. 10. Compiling and debugging the LED_BLINK program

The other end of the JTAG adaptor shown in figure 4 is connected to the printer port (LPT) of the computer. Detailed description of the above procedure is given in IAR EWB manual [12].

167

Page 4: [IEEE 2013 International Conference on Communications and Signal Processing (ICCSP) - Melmaruvathur, India (2013.04.3-2013.04.5)] 2013 International Conference on Communication and

IV. DETAILS OF INDIVIDUAL EXPERIMENTS

The total experiments developed and described in this paper are divided into three modules A, B, and C. The first module explains the basic input/output interfacing. Module B corresponds to the experiments for exploitation of on-chip peripherals. Sensor interfacing with MSP430F149 is described in Module C. Here the student is expected to use theoretical knowledge in assembling the hardware interface circuit and the practical aspect is fulfilled by the successful software development, and verifying the result by powering up the circuit, in stand-alone mode.

Module A: Ex A.1: LED Blink Experiment:

This experiment is generally named as hello program in embedded systems. Required components: LED, Push button, resistors, capacitor and connecting wires. In this experiment P1.0 pin is used as output pin. The circuit shown in figure 11 is assembled on a bread board.

Fig. 11. Hardware schematic diagram of LED blink

The software is developed basing on the following algorithm: 1. Start. 2. Stop watchdog timer. 3. Make P1.0 pin as data out direction. 4. Make P1.0 high. 5. Keep LED toggling in continuous loop. The program is dumped on to the flash memory of MSP430F149 daughter board and +3.3V power supply is applied. After pressing the RESET button, the student is asked to check whether the LED is blinking or not. The student is further asked to change the blinking rate by changing the delay sub-routine. The photograph of the hardware is shown in figure 12. In this experiment, the LED is already connected on the daughter board.

Fig. 12. Photograph of LED blink experment

Ex A.2: Binary count display on LEDs Experiment: In this experiment Port P1 is programmed as output port.

Required components: Eight LEDs, Eight current limiting resistors (220 ), RESET components (Push button, resistor, and capacitor), and connecting wires. The circuit is assembled on a bread board as shown in figure 13.

Fig. 13. Hardware schematic for binary count display on LEDs experiment The software is developed basing on the following algorithm: 1. Start. 2. Stop watchdog timer. 3. Make Port P1 as data out direction. 4. Initialize: a=0 to display data on Port P1. 5. Keep 00 – FF hexadecimal number display in continuous loop. Program in the form of hex file is dumped on to the flash memory of the IC on the daughter board. +3.3V power supply is connected and after pressing the RESET button, the student is asked to record the results. The photograph of the hardware is shown in figure 14.

Fig. 14. Photograph of 00-FF display on leds experment Ex.A.3: LED Blink Shift Experiment:

In this experiment, Port P6 is used as output port. Required components: eight LEDs, current limiting resistors, RESET components, bread board and connecting wires. The circuit assembly on the bread board is shown in figure 15. The output is in negative logic (LEDs are in current sink mode). The software is developed basing on the following algorithm:

168

Page 5: [IEEE 2013 International Conference on Communications and Signal Processing (ICCSP) - Melmaruvathur, India (2013.04.3-2013.04.5)] 2013 International Conference on Communication and

1. Start. 2. Stop watchdog timer. 3. Make Port P6 as data out direction. 4. Initialize Port P6 with 0x01. 5. Realize led blink shift by making P6OUT logical left shift with logical ‘1’. This program is kept in continuous loop.

Fig. 15. Hardware schematic for Blink Shift experment

Program describing the above algorithm is written C, and the corresponding hex file is loaded on the flash memory of the MSP430F149. +3.3V power is applied and RESET button is pressed. Observe the logic’0’ is shifted in the form of LED (negative logic). Figure 16 shows the photograph of the working blink shift experiment. MSP430F149 daughter board, Bread board, +3.3V power supply, eight 220 resistors, eight LEDs and connecting wires are used. The photograph of the hardware is shown in figure 16.

Fig. 16. Photograph of LED blink shift experment Ex.A.4. Seven Segment Display Interfacing Experiment

In this experiment P4.0 to P4.7 pins are used for interfacing seven segment display. Components required: common anode type seven segment display, current limiting resistors, RESET components, bread board and connecting wires. Formulate the look-up table for displaying 0-F hexadecimal numbers on the seven segment display. Software is developed basing on the following algorithm: 1. Start. 2. Stop watchdog timer. 3. Make Port P4 as data out direction. 4. Enter the look up table in the form of array. 5. Keep displaying hex numbers in continuous loop.

The program is uploaded to the microcontroller on the daughter board. The circuit assembly is shown in figure 17. Power up the board with +3.3V. Press the RESET button and observe the seven segment display showing hex numbers 0 to F. Figure 18 shows the photograph of the experiment. Observe that the hex number’s is displayed on the seven segment display.

Fig. 17. Hardware schematic for Seven Segment Display experment

Fig. 18. Photograph of 0-F display on sevensegment display experment

Ex.A.5. Stepper Motor Interfacing Experiment In this experiment the stepper motor interfaced with

MSP430F149 using port P4.0 to P4.3. As the port outputs of the controller cannot drive the stepper motor directly, the power amplifier IC ULN2003 is used. It provides the necessary current to drive the motor. Collect a stepper motor from the junked floppy drive mechanism, IC ULN2003, RESET components, connecting wires and bread board. Assemble the circuit shown in figure 19, on the bread board.

Fig. 19. Hardware schematic for stepper motor interface experiment

The stepper motor is rotated in steps continuously, by developing the software basing on the following algorithm: 1. Start. 2. Stop watchdog timer. 3. Program higher nibble of Port P4 as data out direction. 4. Send data through Port P4.

169

Page 6: [IEEE 2013 International Conference on Communications and Signal Processing (ICCSP) - Melmaruvathur, India (2013.04.3-2013.04.5)] 2013 International Conference on Communication and

5. Keep on sending data which rotates motor continuously. Hex file developed basing on the above algorithm is

dumped on MSP430F149 daughter board. +3.3V and +5V, are applied to microcontroller and ULN2003, stepper motor, respectively. Figure 20 shows the photograph of the experiment.

Fig. 20. Photograph of Stepper motor interfacing experment. Ex.A.6. LCD Interfacing Experiment

A 16X2 LCD module [13], is used in this experiment. LCD module is used in 8-bit mode. Port pins P4.0 to P4.7 are used for sending data, and pins P5.0 and P5.1 are used as control pins, between microcontroller and LCD module. Collect the LCD module, 10k pot. For intensity control of LCD module, RESET components, bread board and connecting wires. The circuit is assembled as shown figure 21.

Fig. 21. Hardware schematic for LCD module interfacing experment.

Program is developed to display S.K.U. on first line of LCD, using the following algorithm: 1. Start. 2. Stop watchdog timer. 3. Initialize ports P4 and P5 pins for LCD communication. 4. Initialize LCD. 5. Keep on sending characters S.K.U. continuously. Figure 22 shows the S.K.U. display on LCD module.

Fig. 22. Photograph of LCD interfacing experment

Ex.A.7. Push button interface, debouncing and count display on LCD module experiment

The main aim of the experiment is to debounce a mechanical switch by software while counting the number of times the button is pressed. The decimal number corresponding to the number of pushes after debouncing is displayed on LCD. Push button is connected to P2.5 pin. P4.0 to P4.7 is used for data sending to LCD and P5.0 and P5.1 are used as control pins. Collect a mechanical switch, LCD module, RESET components, bread board and connecting wires. Assemble the circuit shown in figure 23.

Fig. 23. Hardware schematic for push button debouncing experment Program is developed to display the number of pushes on

LCD module after software debouncing, using the following algorithm: 1. Start. 2. Stop watchdog timer. 3. Initialize P2.5 as input pin to read pushbutton status. 4. Initialize ports P4 and P5 pins for LCD communication. 5. Initialize LCD. 6. Keep number of pushbutton pushes display in decimal on LCD in continuous loop.

After dumping the program on to the microcontroller, the MSP430F149 daughter board is powered with +3.3V and the LCD module with +5V power supply. Pressing the RESET button makes the circuit to work on standalone mode displays the pushes count on LCD module. The photograph showing the count on LCD is shown in figure 24.

Fig. 24. Photograph of interfacing and debouncing of push button experment With the description of the above experiment, Module A comes to an end. Thus, Module A has focused more on basic input/output (I/O) programming. Performing these experiments, gives confidence in programming and working with the MSP430F149 microcontroller, in stand-alone mode.

170

Page 7: [IEEE 2013 International Conference on Communications and Signal Processing (ICCSP) - Melmaruvathur, India (2013.04.3-2013.04.5)] 2013 International Conference on Communication and

Module B: Ex B.1: Measurement of analog voltage using on-chip ADC:

The MSP430F149 has a 12-bit on-chip analog-to-digital converter (ADC), with an accuracy of 1.0 mV. It has 16 selectable analog input channels (External 8 channels + Internal 8 channels; external are multiplexed with Port 6). The conversion time depends on the frequency of the selectable ADC clock. Converted data (12-bit) can be stored in any of the 16-bit register (ADC12MEM0-ADC12MEM15). Components required: LCD Display, 1k (10turn) Pot, 10k Pot, Bread board, RESET components and connecting wires. Assemble the circuit shown in figure 25.

Fig. 25.Cicuit digram for the measurement of analog input voltage Software is devloped to measure the analog input voltage from P6.5 and to display the voltage on LCD module. The corresponding algorithm is given below: 1. Start. 2. Stop watchdog timer. 3. Initialize ports P6; P4 and P5 pins for LCD communication. 4. Initialize LCD. 5. Displaying of characters S.K.U. (through P4OUT) on LCD. 6. Initializing ADC12 and selecting channel 1 for reading external analog input from 10k pot. 7. Measure the external input voltage and display decimal value on LCD in using interrupt service routine (ISR). The hex file is dumped to the microcontroller and power (+3.3V) is applied to the daughter board and to the 1k potentiometer. RESET button is pressed. The display shows the analog input volage available at the selected channel (figure 26).

Fig. 26. Photograph of the analog input measurement using on-chip 12-bit ADC. The display shos S.K.U. on its first line and 1118.72 mV.

Ex B.2: Temperature measurement using on-chip sensor: The MSP430F149 microcontroller is provided with internal

integrated temperature sensor. The channel for selecting integrated temperature sensor is A10. The calibration of internal temperature sensor is provided in MSP430F149 user guide [14]. Components required: RESET components, LCD

module, bread board and connecting wires. Assemble the circuit shown in figure 27.

Fig. 27. Circuit diagram for measuring and displaying of on-chip temperature sensor readings

The on-chip sensor output is routed to the analog input channel of on-chip ADC. The LCD P4.0 to P4.7 is used for displaying temperature and P5.0-P5.1 pins are used as control signals for the LCD. +5V is used for LCD and +3.3V for MSP430F149 daughter board. Following is the algorithm: 1. Start. 2. Stop watchdog timer. 3. Initialize ports P4 and P5 pins for LCD communication. 4. Initialize LCD. 5. Initialize ADC12 by selecting channel 10 for reading internal temperature sensor. 7. Keep conversion of temperature reading in decimal number system and display on LCD using ISR.

The hex file created for the C program developed using the above algorithm is dumped on to the daughter board, and is powered with +3.3V. +5V is applied to the LCD module. The temperature display on LCD is shown in below figure 28.

Fig. 28. Photograph of measurement of temperature using internal temperature sensor .

Ex B.3: Sending A-Z characters to personal computer: Serial communication is easay and efficient protocal for

tranferring data for long distances [15]. The MSP430F149 has two on-chip USARTs. The clock frequency for the USART is selected using software and baudrate 9600bps is set with USART baud rate control registers. Components required: MAX232, DB-9 connector, RESET components, capacitors and conecting wires. the circuit is assembled as shown in figure 29.

171

Page 8: [IEEE 2013 International Conference on Communications and Signal Processing (ICCSP) - Melmaruvathur, India (2013.04.3-2013.04.5)] 2013 International Conference on Communication and

Fig. 29. Circuit diagram for sending A-Z characters to personal computer

Program is developed on MSP430F149 to send the characters A-Z to desktop system, using the following algorithm: 1. Start. 2. Stop watchdog timer. 3. Select P3.4, P3.5 as TXD and RXD pins. 4. Enable USART0 transmit and receive. 5. Select 8-bit data length. 6. Select UCLKI as clock source for USART. 7. Load USART baud rate control registers UBR00 and UBR10 with 0x03 and 0x00 data. 8 Load UMCTL0 is with 0x4A, this select modulation for BRCLK. 9. Disable SWRST. 10. The ASCII equivalent of characters A-Z is sent through MSP430F149 to desktop, continuously.

The generated hex file, for the C program developed by above algorithm is dumped on to the flash memory of the MSP430F149 and powered with +3.3V. +5V is applied to the IC MAX232. The hardware connections are shown in figure 30. On Pressing of the RESET button, the continuous display of A-Z charaters is displayed on the monitor, as shown in figure 31.

Fig.30. Photograph hardware connections for sending A-Z characters to personal computer.

Fig.31. Photograph of A-Z characters display on personal computer.

Ex B.4: 0.25 KHz pulse generation using watchdog timer: Watchdog timer performs restart on system when the

software problems occurs. Here watchdog timer control resister is used to set the 1.9ms interval timer and interrupt is enabled. Port pin P1.0 is used to realize the funtionality of watchdog timer as interval timer. Components required: CRO, RESET components and connecting wires. The circuit is assembled as shown in below figure 32.

Fig. 32. Circuit diagram for generating 0.25 KHz pulse using watchdog timer

Program for generation of 0.25KHz freuency pulse using watchdog timer is described using following algorith: 1. Start. 2. Initialize watchdog register WDTCTL for 1.9msec interval generation and enabled interrupt. 3. Initialize P1.0 as output port. 4. In interrupt service routine toggle P1.0 for every 1.9msec.

The hex file generated for C program developed by above algorithm is loaded into the flash memory of MSP430F149 and powered with +3.3V. on pressing of RESET, the interval timer functionality of the watchdog timer is realised in the form of 0.25KHz freuency pulse at output of P1.0 pin. The pulse is visualised on CRO is shown below figure 33.

Fig. 33. Photograph of 0.25KHz pulse on CRO.

Ex B.5: PWM realization using CRO: Timer compare register TACCR0 is used to set the time

period of the pulse and TACCR2 register is used for pulse width change. The pulse width modulation out at pin P1.7 is realized using CRO. Components required: CRO, RESET components and connecting wires. The circuit assembled as shown in below figure 34.

172

Page 9: [IEEE 2013 International Conference on Communications and Signal Processing (ICCSP) - Melmaruvathur, India (2013.04.3-2013.04.5)] 2013 International Conference on Communication and

Fig. 34. Circuit diagram for realisation of PWM using CRO

Program for pulse width modulation pule is developed using below algorithm: 1. Start. 2. Stop watchdog timer. 3. Select ACLK clock source as Timer A clock source and Timer A is cleared. 4. Store Timer A compare register with 255 count. 5. Set Timer A output in toggle mode. 6. Select Toggle output mode. 7. Stop Timer A and set Timer A in up mode (The timer counts up to TACCR0). 8. Initialize P1.7 as output. 9. Select P1.7 as PWM output pin. 10. Continuous change of PWM is realized on CRO.

The hex file generated for developed C program as following above algorithm is dumped into the flash memory of the MSP430F149 and powered with +3.3V. The hardware connections are shown in figure 35. On pressing of RESET button, the continuous PWM is visualised on CRO. The pulse width modulation pulse is shown in below figure 36.

Fig 35. Photograph of hardware connections for PWM output.

Fig 35. Photograph of PWM output on CRO.

Ex B.6: Frequency measurement system: Timer A capture input pin P2.2 is used for the measurement

of frequency of the input pulse. Timer A is set in timer mode. On first rising edge of the pulse the timer capture register TACCR0 data is stored in cap1 and on second rising edge of the pulse TACCR0 data is stored in cap2. These values give the frequency of the pulse. Components required: frequency generator (MSP430F149), RESET components and connecting wires. The circuit is Assembled as shown in below figure 36.

Fig. 36. Circuit diagram for frequency measurement system

Program for frequency measurement is developed using below algorithm: 1. Start. 2. Stop watchdog timer. 3. Select XT2 oscillator as clock source. 4. Initialize P2.2 as capture input pin. 5. Initialize Timer A as timer. 6. Enable capture on rising edge of input pulse to P2.2. 7. Start timer in continuous mode. 8. Enable all interrupts. 9. Capture CCR0 on first rising edge and store it in cap1. 10. Capture CCR0 on second rising edge and store it in cap2. 11. Now call the subroutine to calculate the frequency and display. 12. This program continuously measures frequencies due to periodic rising edge in pulse.

The hex file generated for developed C program as following above algorithm is dumped into the flash memory of MSP430F149 and powered with +3.3V. On pressing of RESET button, the input pulse frequency is displayed on LCD. Frequency display on LCD is shown in figure 37.

Fig 37. Photograph of frequency measurement system.

173

Page 10: [IEEE 2013 International Conference on Communications and Signal Processing (ICCSP) - Melmaruvathur, India (2013.04.3-2013.04.5)] 2013 International Conference on Communication and

Module C: Ex C.1: RPM measurement system:

The functionality of the RPM measurement system is similar to the frequency measurement system. The frequency of the output pulse from the proximity sensor gives the RPM of DC motor. Components required: DC motor, LCD, RESET components and connecting wires. The circuit is assembled as shown in below figure 38.

Fig. 38. Circuit diagram for frequency measurement system

Program for RPM measurement and display is developed using below shown algorithm: 1. Start. 2. Stop watchdog timer. 3. Select XT2 oscillator as clock source. 4. Initialize P2.2 as capture input pin. 5. Initialize Timer A as timer. 6. Enable capture on rising edge of input pulse to P2.2. 7. Start timer in continuous mode. 8. Enable all interrupts. 9. Capture CCR0 on first rising edge and store it in cap1. 10. Capture CCR0 on second rising edge and store it in cap2. 11. Now call the subroutine to calculate the RPM and display. 12. This program continuously measures RPM due to periodic rising edge in pulse.

The hex file generated for developed C program as following above algorithm is dumped into the flash memory of MSP430F149 and powers with +3.3V. On pressing RESET button, the RPM of the motor is displayed on LCD as show in below figure 39.

Fig 39. Photograph of RPM measurement system.

Ex C.2: LM35 interfacing with MSP430F149: The LM35 is internal signal conditioned temperature sensor

[16]. Analog input channel of ADC12 P6.5 is selected for reading LM35. Components required: LM35, LCD, RESET

components and connecting wires. The circuit is assembled as shown in below figure 40.

Fig. 40. Circuit diagram of LM35 interfacing with MSP430F149 Program for interfacing LM35 to MSP430F149 is

developed as shown in below algorithm: 1. Start. 2. Stop watchdog timer. 3. Initialize port pin for LCD. 3. Display S.K.U. on first line. 4. Initialize ADC12 register for reading analog input from LM35. 5. Convert the analog data into temperature and display on LCD.

The hex file generated for the developed C program using above algorithm is dumped into the flash memory of MSP430F149 and powered with +3.3V. On pressing of RESET button, the temperature value measured using LM35 is displayed on LCD as shown in figure 41.

Fig 41. Photograph of interfacing LM35 with MSP430F149. Ex C.3: HSM-20G interfacing with MSP430F149: Analog input channel (A7) of ADC12 is selected for

measurement of analof output voltage from HSM-20G. components required: HSM-20G, LCD, RESET components, and connecting wires. The circuit is assembled as shown in below figure 42.

Fig. 42. Circuit diagram of HSM-20G interfacing with MSP430F149

174

Page 11: [IEEE 2013 International Conference on Communications and Signal Processing (ICCSP) - Melmaruvathur, India (2013.04.3-2013.04.5)] 2013 International Conference on Communication and

Program for interfacing HSM-20G with MSP430F149 is developed as shown in below algorithm: 1. Start. 2. Stop watchdog timer. 3. Initialize port pin for LCD. 4. Display S.K.U. on first line. 5. Initialize ADC12 register for reading analog input from HSM-20G. 6. Convert the analog data into humidity and display on LCD.

The hex file generated for developed C program using above algorithm is dumped into the flash memory of the MSP430F149 and powered with +3.3V. On pressing of RESET button, the humidity value is displayed on LCD as shown in figure 43.

Fig. 43. Photograph of humidity measurement using HSM-20G and display it on LCD.

V. CONCLUSIONS

A bunch of experiments useful for one third semester laboratory for an under-graduate ECE/CSE laboratory which is designed and developed in author’s laboratory is explained in this paper. These experiments can be introduced in a laboratory course as take-home experiments, because of its low budget. The hands-on experience a student gets by performing these experiments definitely gives a confidence to think and develop a complex embedded system, which is very much essential in the present scenario.

ACKNOWLEDGMENT U.Naveen Kumar is thankful to University Grants

Commission (U.G.C.), New Delhi, for the sanctioning of Junior Research Fellowship ( B.S.R).

REFERENCES [1] Mitsui. H, Kambe. H , and Koizumi,. H “ Use of Student Experiment

for Teaching Embedded Software Development Including HW/SW Co_Design” , IEEE Transactions on Education, vol. 52, pp. 436-443, Aug. 2009.

[2] Crespo. A, Vila. J, Blanes. A and Ripoll . I “ Real time education in a control engineering Curriculum”, in 3rd IEEE Real time systems education workshop, 1998, pp. 112-116.

[3] K. G. Ricks, D. J. Jackson and W. A. Stapleton, “ Incorporating Embedded programming skills in to an ECE Curriculum”, SIGBED Rev., vol .4, no.1, pp .17-26, Jan. 2010.

[4] Jiang Xiaoluo and Li Han, “ CDIO – Based Embedded systems training mode in graduate teaching”, 5th International conference ondistance learning and education, vol. 12, pp. 78-82, 2011.

[5] D.Davcec, B. Stojkosa, S. Kalajdziski, and K. Trivodaliev, “Project Based learning of Embedded Systems”, in proceedings of the 2nd WSEAS Telecomunications, 2008.

[6] S. Nooshabadi and J. Garside, “Modernization of teaching in embedded Systems design–An international collaborative project”, IEEE Transactions on Education, vol. 49, no. 2, pp. 254-262, May 2006.

[7] J. W. Bruce, J. C. Harden, and R. B. Reese, “Cooperative and progressive design experience for embedded systems”, IEEE Transactions on Education, vol. 47, no. 1, pp. 83-92, Feb. 2004.

[8] Wilfried Elmenreich, Christian Trodhandl and Bettina weiss, “Embedded system Home Experimentation”, Proceddings of the 2003 IEEE International Conference on Microelectronic systems Education (MSE 03)

[9] Nagy, Chris., “ Embedded System Design using the TI MS430 Series “, BOSTON: Newnes, 2003.

[10] John H. Davies, “ MSP430 Microcontroller Basics”, Newnes publications, 2008.

[11] www.ti.com/tool/iar-kickstart. [12] MSP430 IAR Embedded Workbench IDE User Guide for Texas

Instruments ‘ MSP430 Microcontroller family, forth Edition, April 2005 [13] http://pdf1.alldatasheet.com/datasheet-

pdf/view/111499/HITACHI/HD44780U.html. [14] Texas instruments MSP430x1xx Family User’s Guide, SLAU049E,

Texas Instruments incorporated, 2005. [15] Axelson, Jan, “Serial Port Complete,” Lakeview Research, 2nd edition,

2007. [16] LM35 Precision Centigrade Temperature Sensor, Literature Number:

SNIS 159B,Texas Instruments, November 2000.

175