Pages

microcontroller using IAR Embedded Workbench

Summary: This is a short tutorial created by a student at the University of North Florida to help familiarize students with constructing the PCB and Flashing a program onto the microcontroller using IAR Embedded Workbench.


Embedded System Design 

graphics1.png 

 
TI MSP430F449 Microcontroller
  
 

Table of Contents

Topic:

  • Background
  • Introduction
  • Board Construction
  • Soldering
  • Soldering Surface Mounted Components
  • Soldering the MSP430
  • Mounting the LCD Display
  • Order for Soldering Components to Board
  • Sample Devices From Industry
  • Texas Instruments' MSP430F449 Samples
  • Sensors
  • Project Software
  • Programming the MSP430F449
  • Appendix

Background:

The purpose of the student tutorial is to introduce and familiarize the user with the Embedded System Design utilizing the TI MSP430F449 microcontroller. In addition, the student tutorial serves as a guide on how to assemble the Printed Circuit Board (PCB) along with a sensor of choice. The guide also includes an introduction on programming the TI MSP430F449 using the Embedded IAR Workbench. The student will need the Flash Emulation Tool (FET) kit purchased from Texas Instruments that allows connection from the Personal Computer (PC), where the software or micro program is developed, to the PCB the student constructs. Basically, the student downloads or “Flashes” the micro program to the MSP430F449 Flash nonvolatile memory. More information about the TI MSP430F449 microprocessor is available at http://www.ti.com. Under Products, click on Analog and Mixed Signal MSP430 Ultra-Low-Power MCU.
The parts kit allows the student to build a circuit board with the TI MSP430F449 microprocessor, a sensor of choice, along with an LCD display. The micro program to for the TI MSP430F449 is mostly developed in the C programming language with the aid of a software package, the Embedded IAR Workbench.
After the PCB is constructed, a micro program with a message such as HELLO to be displayed on the LCD is prepared and placed in Flash memory, (“flashed”). A valid message on the LCD indicates that the soldering was correct and the circuits are functioning. After some familiarity is developed with the system, the student is responsible for connecting a sensor to the PCB and writing the software (micro program) that allows the sensor to display a reading on the LCD.
This student tutorial is intended for the student to have fun and to learn how to use a microprocessor to design an Intelligent Sensor. This serves as a foundation to build upon for later courses and to stimulate an interest in the art of Embedded System Design.

Introduction:

The purpose of this student project is multi-fold.

  • It provides the opportunity to work as a member of a team.
  • The student starts by learning to interpret a printed circuit board (PCB) layout. Several components will be provided to mount (solder) on to this board.
  • Learn some basic skills of making ultra-find solder connections.
  • Learn some basic steps of troubleshooting a printed circuit board (PCB).
  • Pull-together files to form a project and compile and link the programs of the project.
  • Introduction to the IAR debugging tool.
  • Learn to flash software to the microprocessor mounted on the PCB.
  • Select a sensor and learn the characteristics of the sensor.
  • Write a program to allow the student to read the analog voltage of a sensor into the MSP430F449 and display the signal in appropriate units on the PCB’s LCD.
  • The expected outcome from this tutorial is that the student becomes familiar, at a first level, on how several aspects of engineering (hardware construction, software development, sensors) are brought together to form an intelligent sensor.

Board Construction:

Table 1 shows a list of parts that are needed to carry out the main objectives in the student tutorial. Be sure to take an inventory of the items listed in Table 1.
There are soldering stations and microscopes available to accomplish the student tutorial. A microscope is necessary to see how to do the soldering work. This will be realized as practice in soldering is done often and over time. Solder and flux are provided with the soldering stations.
The student is expected to solder two surface mounted 0.1 uF capacitors to the printed circuit board. In addition, the user is expected to solder all 100 pins of the MSP 430F449 package to the printed circuit board.
TABLE 1: Inventory of Parts
Item #Description (Digikey)Quantity
1MHC14K-ND: JTAG Connector1
2EG1868CT-ND: Push Button Switch1
3CP-102A-ND: Power Connector1
4LM2937IMP-3.3CT ND: Voltage Regulator1
5CT2192MST-ND: Switch 2 position1
6300-1001-ND: 32.7 kHz Crystal1
7399-1249-1-ND: 0.1uF SMD capacitor3
8399-1296-1–ND: 1uF SMD capacitor1
9311-47kECT-ND: 100 kohm resistor2
10SBLCDA2: LCD Display1
11circuit board - no mask - practice soldering1
12circuit board - with mask - final product1
13miscellaneous 24 gauge wire2
14TI MSP430F449IPZ chip1

Soldering:

Avoid breathing the fumes from the solder. The solder is rosin core with a certain percentage of lead (about 2%). It is not healthy to breathe these fumes. Read the label on the soldering tube provided with the soldering station and use the precautions given on the label.
Set the temperature of the soldering station to 800 F. After the tip has reached this temperature, dip the tip of the iron into the tinning paste. Clean the tip with the sponge that comes with the station (add water to the sponge). After this step you may want to take a knife blade and lightly scrape the tip of the iron. Repeat dipping the tip in the tinning past and cleaning the tip on the sponge until the lower 1/4 inch of the tip is “silvered.” A clean silvered tip is the first indication that the tool has passed the first necessary step toward being properly tinned. Next, touch a strand of solder to the tip. If the solder balls up and drops from the tip, then the tip is not properly tinned. Repeat the above steps until the solder will stick to the tip. At that point the tip is properly tinned and ready for use. Another thing; when you are through soldering, always clean the tip before turning off the station. You might want to take the edge of a knife blade and lightly scrape the tip. Be careful when using the soldering iron. Soldering iron burns hurt! So does melted solder that splashes on you!

Soldering Surface Mounted Components:

Figure 1 illustrates a top view representation of the PCB utilized to mount the MSP430F449 and the SoftBaugh LCD among other components.
Figure 1: Illustration of the MSP430F449 board.
Figure 1 (graphics2.png)


Now consider soldering a surface mounted (SMD) device such as the MSP430F449, a resistor or capacitor to a board. The PCB has a solder pad or tab for each end of the SMD pads to rest. This is indicated in Figure 2.
Figure 2: Illustrating surface mounted component on a board.
Figure 2 (graphics3.png)


The PCB pads are thin and most often do not provide enough solder for connecting the SMD component. Before placing the SMD component on the board, one should flux and lightly tint each tab. To do this, take a toothpick or similar object and deposit and ever so slight amount of flux on each pad. Next, place the tip of the soldering iron in the tinning paste, remove and clean on the sponge. Now touch the tip to a strand of solder and tin-up the tip of the iron. Focus in on the tabs and bring the tip of the iron over one of the tabs. Touch the tip of the iron to the tab and slight rub the tip over the tab to deposit a thin layer of solder that should bond with the board tab. Do this to each tab. Now take a pair of tweezers and hold the SM component in place. Bring the tip of the iron to one edge of the tab and melt the solder. Figure 3 illustrates the tab for each pin of the MSP430F449 soldered onto the board.
Figure 3: Soldered in place MSP430F449.
Figure 3 (graphics4.png)


Do not touch the tip to the SMD component. As the solder on the tab melts, the solder on the tip of the SMD component will also melt. In order to observe all this, a microscope will be needed. Remove the tip of the iron but hold the component in place, momentarily, for the solder to cool and set. Remove the tweezers and repeat the process at the other end of the component. Most often there is a good bond and no further soldering is required. Furthermore, there is a slight change in the procedure for mounting polarized capacitors. This slight change is illustrated in Figure 4.
Figure 4: Drawing showing surface mounted polarized capacitor.
Figure 4 (graphics5.png)


Also, on many polarized capacitors the two small solder tabs have the same size. In this case the backside of the capacitor will have a small stripe to indicate the + (positive) terminal of the capacitor. One should always check the source catalog for this information if it is not clear which side is positive.

Soldering the MSP430 to the Board:

The MSP 430F449 is a very fine-pitch chip. That is, the connect point to the chip are numerous and very close together. There are 25 connect points on each side of the chip. The chip is roughly 1/2 inch on each side. That is, one is looking at roughly 25 connect points spread over 1/2 of an inch. To mount the MSP 430 to the PCB requires some tedious soldering work.
Start by placing the board on the microscope with the base light and top light of the microscope turned on. This provides heat to the board that will be helpful in the fluxing process. Consider the diagram of Figure 3 that represents the portion of the PCB where the MSP 430 will be mounted.
Figure 5: Board pin layout for the MSP430.
Figure 5 (graphics6.png)


The student should take an appropriate object such as a toothpick with flux on the tip and place the flux in the shaded areas shown on the circuit traces of Figure 5. Next, place the MSP 430 on the trace pattern above with the MSP 430 centered all-around. This takes a little time. Be careful to align the connect points to the PCB completely around the MSP 430. The notch on the bottom left corner of the MSP 430F indicates the placement of the first pin.
Figure 6: Showing the MSP430 placed on circuit traces.
Figure 6 (graphics7.png)


With all the connect points of the MSP 430 on top of the corresponding PCB pads, hold things in place and use the soldering iron to tack a connect point of the chip to a trace at pins 25 and 1 as shown above. DO NOT ADD ANY SOLDER TO THE TIP OF THE SOLDERING IRON! Set things up as shown in Figure 5. Apply a touch of flux to the tip of each microchip pin.
Figure 7: Soldering technique for connecting MSP430 to traces on board.
Figure 7 (graphics8.png)


At pin 25, shown in Figure 6, continue to hold the chip in place. Place the tip of the soldering iron on the circuit trace as shown above. The solder on the trace will melt. This should temporarily tack the circuit connect point to the trace. Allow the solder joint to cool for about 5 seconds. Continue to hold the chip in place. Move to another corner point on the chip (pin 1) and repeat the above process. At this point the chip should be tacked to the traces and lined up properly. Now move to another connect point (pin 24) and place the tip of an exacto knife on top of the chip connect point as shown in Figure 7. Apply the tip of the soldering iron to the corresponding circuit trace and allowing the solder on the trace to flow. Place the tip of the xacto knife on top of the connect point to the board; remove the soldering iron tip and apply a small pressure (with the xacto knife) to hold the connect point down; allow the junction to cool for a few seconds.
Then, the above process is continued by moving around the board. A good idea is to pin down connect pin 2 then move to pin 23. This allows connect point at pin 2 to cool for a few seconds before coming back to solder at pin 23 and so on. If at some point there does not seem to be enough solder on the traces to bond to the connect point, try placing the soldering iron tip in the tinning paste. Clean on the sponge. There is usually a slight amount of solder left on the tip. This can be used to add a little solder to the trace.
After soldering all the pins to the board, the user should check the connections. A good way to do this is to place the tip of your xacto blade to the edge of each pin. Apply a slight amount of pressure to the pin. If the pin moves you know you have a faulty solder connection. Clean and flux the tip of the soldering iron two or three times and then proceed to Re-do the solder joint.

Mounting the LCD Display:

The SoftBaugh LCD display unit has 24 pins on each side. The following procedure establishes one manner in which to mount the unit to the board.
To begin with, the small notch at one end of the LCD should be on the left side when lining up pins on the board. Place the pins on one side of the unit over the corresponding holes on the board. Slightly jiggle the unit until you can get the one side to slide into the holes. There are times when slightly jiggling the unit will result in both sides of the LCD to smoothly slide into the holes of the board. However if this is not the case, do not try to force the pins into the holes. It is fairly easy to get one side of the unit to go into the board. Where the pins emerge from the bottom of the board, keep the tips about flush with the board. Then attempt to line things up with the other side of the LCD. Start at one end and use the tip of a xacto knife to move each pin over the corresponding hole. Continue to move down the pin line and line up the pins with the holes. Once the pins have lined up, the second side will fit in place. Push the LCD in place with the pins protruding from the back of the board.
Now that the LCD is in place, flip the PCB over and solder the pins to the PCB. To do this bring the solder tip next to a pin; touch the pin with the strand of solder. The solder “sucks” down into the hole on the PCB. Figure 8 illustrates the SoftBaugh LCD mounted on the board.
Figure 8: Mounted SoftBaugh LCD Display.
Figure 8 (graphics9.png)


The remaining components are relatively easy to mount to the PCB. In mounting the switches, it is a good idea to apply a small amount of flux to the solder pads and even tin the tips of the switches with a slight amount of solder. This makes it easier to solder the switches to the board.
The PCB for this project was designed to serve the needs of several projects at the university. Therefore, the board is populated according to the particular project. The lettering on the board identifies the surface mounted capacitors for this tutorial and Figure 9 illustrates the board with most of the essential components mounted.
Figure 9: PCB with Components Mounted.
Figure 9 (graphics10.png)

Order for Soldering Components to Board:

The following order is recommended for soldering components to the board. (1) The MSP430F449. (2) Surface mounted capacitors and resistors next. (3) Push button switch, voltage regulator, 5 volt input plus, slider switch. (4) Now solder in the pins of the JTAG connector. (5) Wait until last to solder in the SoftBaugh LCD.

Sample Devices from Industry:

Most all industries support students in their quest for learning about particular products from their company. Within reason, companies will provide samples of devices for students to use in their projects. There are at least two reasons that come to mind as to why they want to provide this support. First, they support education. Engineers, with good educations, are the foundation or backbone of their company. Second, if students become familiar with their products they are more likely to place orders with them during your professional career.

TI MSP430F449 Samples:

This is the micro computer that is utilized in this tutorial. Samples will be provided to students enrolled in the course. The following Texas Instrument URL is where you can order a 3-lot sample of the MSP430F449. Just follow the instructions. Be sure to give a mailing address where UPS/FedEx or order delivery services can deliver a package to you. You cannot use P.0.Boxes. In filling out the request form for parts indicate as necessary that you are a student working on an embedded microcomputer project. 
http://focus.ti.com/docs/prod/folders/print/msp430f449.html#samples

Sensors:

After you have constructed your board and you know that you can flash a message to the LCD, the next part is for you to select a sensor for application with the PCB you have built. In particular, you are to connect the output voltage from a sensor you select to an input port to the Analog to Digital converter of the MSP 430. You might select a temperature sensor, a force sensor, a magnetic field measurement sensor and so on. The choice of sensor is left up to you. However, you must find a sensor you want to use and you must order free samples.
There are a number of companies that manufacture sensors. One company is Analog Devices. Their web address ishttp://www.analog.com . Other companies such as Texas Instruments and Freescale also provide sample sensors.

Project Software:

The software required for this tutorial is available on the TI website to download for free. The web address to obtain the software is: 
http://focus.ti.com/docs/toolsw/folders/print/iar-kickstart.html
You will find the software from both IAR and TI that supports the Flash Emulation Tool. You are encouraged to spend some time looking over this material.

Programming the MSP430F449:

We now explain how to use the above tool to exercise the embedded processor board so that that the LCD displays a count from A-Z.
First connect the 25-pin cable connecter of the FET to the printer port of your PC. Connect the 14-pin connector to the JTAG port on your board. Be sure this cable is connected in the “Up” position. This is illustrated in Figure 10.
Figure 10: Board with 14-pin connector connected to JTAG port.
Figure 10 (graphics11.png)


Step 1: On your PC create the following directory: C:\430project\software. The files required to implement this student tutorial for the MSP430F449 will be given by the instructor. Once given, copy the files to your Computer. These files may include: lcd.c, lcd.h, lcddemo.c.
Step 2: Take the following path on your PC: Start / Programs / IAR Systems/ IAR Embedded Workbench for MSP430 KickStart/IAR / Embedded Workbench. This will open the screen shown in Figure 11.
Step 3: Now click on Project/Create New Project… and you will see the screen shown in Figure 12.
Step 4: Now double click on the programming language you will be using for the project and click on main. This step is shown in Figure 13. A Save As dialog box appears. Choose a name to save your project under.
Step 5: Once you’ve created your project, this will produce the screen shown in Figure 14.
Step 6: Now click on Project/Options… Under category, highlight general options and select which device you will be using for the project. The screen shown in Figure 15 illustrates this step.
Step 7: From the screen in Figure 15, under category highlight Debugger and choose the FET Debugger as your driver. This will produce the screen shown in Figure 16.
Step 8: Now under category highlight FET Debugger. Choose your connection whether it is USB or not. This is shown in the screen in Figure 17.
Step 9: To add the project files, click on Project/Add Files. Highlight all the files needed for the project and click Open. The files will then be added to your workspace. This is illustrated in the screen shown in Figure 18.
Step 10: Once the files are downloaded, click on the arrow on the top right screen of your window which means you are ready to download and debug your project. This is shown in Figure 19.
Step 11: After building your project, the debugger window opens at the bottom part of your screen. Click on the three arrows encircled in Figure 20 to run the program.
Step 12: Provided that the FET cable is inserted to your PC printer port and the JTAG plug on your processor board andprovided you have built your board correctly, you will see the screen go through a stage of showing that the board is being erased and then show it being programmed. After the programming stage is complete you should see some a count from A-Z scroll across the LCD.
Figure 11: Showing procedure in building software, Step 2.
Figure 11 (graphics12.png)


Figure 12: Showing procedure in building software, Step 3.
Figure 12 (graphics13.png)


Figure 13: Showing procedure in building software, Step 4.
Figure 13 (graphics14.png)


Figure 14: Showing procedure in building software, Step 5.
Figure 14 (graphics15.png)


Figure 15: Showing procedure in building software, Step 6.
Figure 15 (graphics16.png)


Figure 16: Showing procedure in building software, Step 7.
Figure 16 (graphics17.png)


Figure 17: Showing procedure in building software, Step 8.
Figure 17 (graphics18.png)


Figure 18: Showing procedure in building software, Step 9.
Figure 18 (graphics19.png)


Figure 19: Showing procedure in building software, Step 10.
Figure 19 (graphics20.png)


Figure 20: Showing procedure in building software, Step 11.
Figure 20 (graphics21.png)

Appendix

The following specifies the pin-out connections of the MSP430F449 Texas Instrument Mixed Signal Micro controller. Also, a general outline of the physical package is included. For more data on the device, check the following web site.
http://focus.ti.com/docs/prod/folders/print/msp430f449.htmi#technicaldocuments
Look under technical documents/data sheets.
pinout.PNG

MSP430FG4618 device implement a Buzzer tone generator

Summary: Using the MSP-EXP430FG4618 Development Tool and the MSP430FG4618 device implement a Buzzer tone generator.


Buzzer tone generator

Introduction

Correct system timing is a fundamental requirement for the proper operation of a real-time application. The timing definition can dictate how the data information processed during the execution of the application program. The clock implementations vary between devices in the MSP430 family. Each device provides different clock sources, controls and uses. This chapter discusses the clock controls included in the platforms used.
The MSP430 4xx family has two general-purpose 16-bit or 8-bit counters and event timers, named Timer_A, Timer_B, and a Basic Timer. The Basic Timer module is only implemented in ‘4xx devices. The 2xx device family also has Timer_A and Timer_B, but the clock signals are provided by the basic clock module+.
The timers may receive an internal or external clock. Timer_A and Timer_B also include multiple independent capture and compare blocks, with interrupt capabilities.

Overview

The purpose of this laboratory is to build a sound generator using Timer_B. The PWM signal produced by this peripheral drives the buzzer, producing a sequence of musical notes at regular time intervals. At the same time, LED1 and LED2 switch state alternately. The volume of sound produced by the buzzer can be controlled by push buttons SW1 and SW2.

Resources

The implementation of this application ( Lab4_Timers.c ) requires the production of specific frequency signals corresponding to musical notes. For each frequency, the duty-cycle can be modified in order to control the volume of sound produced. This task is carried out using Timer_B and one of its compare units. The buzzer is operated by Port P3.5, configured to work in its special function as TB4 compare unit output. This output corresponds to the TBCCR4 output compare unit.
The push buttons SW1 and SW2 are connected to ports P1.0 and P1.1 respectively. An interrupt is generated when either of these buttons are pressed. The duty-cycle of the generated note is modified in response.
Basic Timer1 is configured to generate an interrupt once every second. The interrupt service routine updates the musical notes produced by the buzzer, which are stored in an array.
LED1 and LED2 are driven from P2.2 and P2.1 respectively, and their state is switched alternately once every second.
The module FLL+ is configured to a 7.995392 MHz frequency, for the MCLK and SMCLK clock signals.
The resources used by the application are:
- Timer_B;
- Basic Timer1;
- I/O ports;
- FLL+;
- Interrupts.

Software application organization

The application consists of the routine main(), which is used to configure all system resources, before entering into a standby mode, waiting for one of two interrupts.
This routine starts by disabling the watchdog timer and starting the module FLL+ to produce the desired clock signals of the correct frequency for the SMCLK and MCLK. Then, the Basic Timer1 and Timer_B are configured in order to perform the desired functions.
The ports connected to the LEDs, buttons and buzzer are then initialized.
Finally, the interrupts are activated, and the application waits for the execution of one of two interrupts.
The Basic Timer1 interrupt executes at a frequency of once every second. When this interrupt is occurs, it begins by switching the state of LED1 and LED2. Afterwards, it accesses the memory to fetch the next musical note to be performed. The routine ends with memory pointer management.
The Port 1 ISR begins by evaluating the source of the interrupt. The sound volume is reduced if the button SW1 is pressed. The sound volume is increased if button SW2 is pressed.

System configuration

Timer_B

It is the responsibility of Timer_B to produce the PWM signal that activates the Buzzer. Timer_B counts until the value contained in the TBCCR0 register is reached. It does not generate an interrupt, and must be sourced by SMCLK clock signal:
TBCTL = TBSSEL_2 | CNTL_0 | TBCLGRP_0 |MC_1 | ID_0;
Each PWM signal produced by Timer_B corresponds to a musical note. The relationship between the frequency and the musical note is given in Table 1.
TABLE 1
NoteSI0DOREMIFASOLLASIDO2
Freq [Hz]50352458766270178787810041048
Timer_B has a frequency clock input equal to 7.995392 MHz.
The value to write in the TBCCR0 register in order to generate the desired frequency is:
// TBCCR0 value of the musical notes
#define SI0 15895
#define DO 15258
#define RE 13620
#define MI 12077
#define FA 11405
#define SOL 10159
#define LA 9106
#define SI 7963
#define DO2 7629
    
TBCCTL4 = OUTMOD_3; // CCR4 interrupt enabled
TBCCR4 = space[0]/2;
    

Timer_A configuration

TACTL = TASSEL_2 |MC_2 | ID_0 | TAIE; // SMCLK, continuous mode up to 0xffff

TACCTL1 = CM1 | CCIS_0 | CAP | CCIE;// Capture on rising edge, Cap mode,
                                    // Cap/Com int. enable, TACCR1 input signal selected
    
//*********************************************************
// Timer A ISR
//*********************************************************
#pragma vector=TIMERA1_VECTOR
__interrupt void TimerA1_ISR (void)
{
 switch (TAIV)
 {
  case TAIV_TACCR1: 
  if (capture == 0){
  T1 = TACCR1;
  flag = 1;
  capture = 1;
 }
 else {
  if (flag == 1) {
   T2 = TACCR1;
   if (T2 > T1)
    T = T2-T1; 
   }
   else{
    TAR = 0;
   }
   capture = 0;
   flag = 0;
  } 
 break;
    
case TAIV_TACCR2:
    break;
    
    case TAIV_TAIFG:
    tick++;
    if (tick == 60){
    LCD_freq();
    tick = 0;
    }
    if (flag == 1)flag = 0;
    
break; 
    
default:
    break; 
    }
}
    

Basic Timer1

The Basic Timer1 generates an interrupt once every second. It uses two counters in series, where the BTCNT2 counter input uses the BTCNT1 counter output divided by 256. The BTCNT1 counter input is the ACLK clock signal with a frequency of 32.768 kHz.
If BTCNT2 counter selected output is divided by 128, what is the time period associated with the Basic Timer1 interrupt? _________
What are the values to write to the configuration registers?
BTCTL = BTDIV | BT_fCLK2_DIV128; // (ACLK/256)/128
IE2 |= BTIE; // enable BT interrupt
    
//*********************************************************
// Basic Timer ISR. Run with 1 sec period
//*********************************************************
#pragma vector=BASICTIMER_VECTOR
__interrupt void basic_timer_ISR(void)
{
unsigned int read_data; // read data from file , frequency in kHz
   
P2OUT^=0x06; // toogle LED1 and LED2
counter++;
    
if (counter == 5){
    counter = 0;
     read_data = 200;
     TBCCR0 = 7995392/read_data;
     TBCCR4 = TBCCR0/2;
    }
}
    

I/O Ports configuration

// SW1 and SW2 configuration (Port1)
P1SEL &= 0x00; // P1.0 and P1.2 I/O
P1DIR &= 0x00; // P1.0 and P1.2 as inputs
P1IFG = 0x00;
P1IES &= 0xFF // high-to-low transition interrupt
P1IE |= 0xFF; // enable port interrupts
    
// LED1 and LED2 configuration (Port2):
P2DIR |= 0x06; // P2.2 and P2.1 as outputs
P2OUT = 0x04; // LED1 on and LED2 off
    
// Buzzer port configuration (Port3)
P3SEL |= 0x20; // P3.5 as special function
P3DIR |= 0x20; // P3.5 as digital output
    

FLL+ configuration

FLL_CTL0 |= DCOPLUS + XCAP18PF; //DCO+ set,freq=xtal*D*N+1
SCFI0 |= FN_4; // x2 DCO freq, 8MHz nominal DCO
SCFQCTL = 121; // (121+1) x 32768 x 2 = 7.99 MHz
    

Analysis of operation

System clocks inspection

The MCLK, SMCLK and ACLK system clocks are available at ports P1.1, P1.4 and P1.5 respectively. These ports are located on the SW2, RESET_CC and VREG_EN lines, which are available on the H2 Header pins 2, 5 and 6. All these resources are available because the Chipcon RF module is not installed and SW2 is not used.
Using the Registers view, set bits 1, 4 and 5 of P1SEL and P1DIR registers to choose the secondary function of their ports, that is, configured as outputs. Connect an oscilloscope probe at these positions to monitor the clock signals.
What are the values measured for each of the system clocks?
ACLK: _____________________
SMCLK: ____________________
MCLK: _____________________

TBCCR4 unit output frequency

With the help of an oscilloscope, it is possible to evaluate the operation of the application. Alternatively, it is possible to listen to the sound produced. By removing jumper JP1 and connecting the oscilloscope to this pin, it is possible to view the PWM signal produced by the microcontroller. The duty-cycle can be reduced or increased by pressing the push buttons SW1 and SW2.

Port P1 interrupt source decoding

All Port P1 interrupt lines share the same interrupt vector. The decoding is done through the P1IFG register.
This process can be observed by entering a breakpoint at the first line of the ISR code.
Execute the application.
The application’s execution is suspended at the breakpoint by pressing either button SW1 or SW2. From this point onwards, run the lines of code step-by-step and observe changes in the register values.

Measurement of electrical current drawn

The power consumption was discussed in the previous point. The electrical power required by the system during operation is measured by replacing the jumper on the Header PWR1 by an ammeter, which indicates the electric current taken by device during operation.
What is the value read? __________
This example and many others are available on the MSP430 Teaching ROM.
Request this ROM, and our other Teaching Materials here https://www-a.ti.com/apps/dspuniv/teaching_rom_request.asp

Share your knowledge

Related Posts Plugin for WordPress, Blogger...

Popular Projects

program for Dual DAC 8051 Microcontroller Based DC Motor Control A Microcontroller Based Turbidity Meter A m -Controller Based Thermostat ASCII to BCD conversion in 8051 AT90LS8515 Digital Message Machine Audio Frequency Response Analyzer Audio Homing Robot Automated Juice Mixer Automated Pet Feeder Autonomous Car Autonomous Parallel Parking RC Car Autonomous Search Robot Autonomous Tank Autonomous Vehicle Contrast Following Rover Autonomous navigating robot BCD number to ASCII in 8051 Balance Bot Blind Bot Blood Pressure Monitor Bloodshed Dev-C++ 5 Compiler/IDE Breath Alcohol Tester Converters on TI MSP430 CrossStudio MSP430 IDE Design of a Real-Time Digital Guitar Tuner Digital Oscilloscope Digital Stethoscope Digital clock project using PIC16C54A microcontroller Digital thermometer ECG monitoring system GPS Data Logger with Wireless Trigger Handwriting Recognition Systm Home Security System Home energy managment IAR Embedded Workbench IDE INFRARED TRACKING SYSTEM IntelliBOT Laser Communications System Line following van MSP-EXP430FG4618 Development Tool and the eZ430 kits MSP430FG4618 device implement a Buzzer tone generator MSP430FG4618 device implement a Real Time Clock MSP430FG4618 device implement a voltage ramp generator MSP430FG4618 device present a message on the LCD Basic Microcontroller(8051) Lab Mivo- RFID based mobile payment system Multi-Zone Fire Alarm System PC based temperature control PIC 16f877 RPM Meter PIC16C54 dual dice electronic project circuit PIC16F84A digital thermometer microcontroller project PIC16F886 horn driver PWM motor contoller with MSP430 Program Block data transfer in 8051 Program to add two BCD numbers in 8051 Program to check whether a 4th bit of a byte is 1 Program to convert ASCII to hex in 8051 Program to count from 0-9 in 8051 Program to count number of 1's in a given data byte in 8051 Program to divide an 8 bit no by another 8 bit number in 8051 Program to find largest of n numbers in 8051 Program to find the LCM of two numbers in 8051 Program to find the square of an 8 bit number in 8051 Program to generate 50msec delay in 8051 Program to implement BCD counter to count from 0-99 in 8051 Program to implement BCD counter to count from 99-0 in 8051 Program to interchange two blocks of data in 8051 Program to multiply 16 bit number by 8 bit number in 8051 Program to search an element in an array in 8051 Program to sort an array of 10 elements in 8051 Programming the ez430 Proximity Security System RAMP wave in 8051 RC Car Controller RObo Dog Radio-controlled Truck Retina color tracker Robotic Arm Controller with GUI Robotic Car Traction Control Safety-sensor vehicle Security Entrance System Self-Powered Solar Data Logger Snake Arm Ultrasonic Positioning Control System Store FFh if 1 Super Train Controller TI MSP430 Microcontrollers Timers on the MSP430 TouchPad Drawing Board Ultra-Sonic Parking Assistant Ultrasonic Parking Controller Ultrasonic Range finder Voice Activated Alarm Clock Voice Recognition Robotic Car Voting Machine Weather Station Web-Monitored Thermostat Wireless Drawing Device Wireless Telemetry Wireless message Communicator Write a C program to display the code of the key pressed in 8051 Zigbee Wireless Relay Control and Power Monitoring System add two multibyte numbers in 8051 convert a decimal number to hex number in 8051 convert an 8bit Hex number to decimal number in 8051 convert hex number to ASCII number in 8051 eZ430-F2013 Development Tool use SD16_A ADC eZ430-RF2500 Development Tool use ADC10 else store 00 in the same location in 8051 find the GCF of two numbers in 8051 find the average of 10 numbers in 8051 generate Fibonacci series in 8051 metal detector project microcontroller using IAR Embedded Workbench program for Elevator Interface in 8051 program for Stepper motor interface in 8051 spectrum analyser square wave in 8051 triangle wave in 8051 voice recognition security system

Sites U missed

Hint

Open Pictures in new page by right click on it, if it is not shown full image.