0% found this document useful (0 votes)
40 views

Exp 11

This document describes a student mini project using an MSP430 microcontroller to control the movement of a servo motor. The project aims to apply programming skills to develop an application using the MSP430. A group of 3 students worked on the project. They used Code Composer Studio software, an MSP430G2 launchpad, a servo motor, and jumper wires. The project involves writing code to rotate the servo motor 180 degrees and reset it to its position using pulse-width modulation signals controlled by the MSP430 timers and registers. The students successfully implemented the project and learned about applications of servo motors.

Uploaded by

Soham Khadke
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
40 views

Exp 11

This document describes a student mini project using an MSP430 microcontroller to control the movement of a servo motor. The project aims to apply programming skills to develop an application using the MSP430. A group of 3 students worked on the project. They used Code Composer Studio software, an MSP430G2 launchpad, a servo motor, and jumper wires. The project involves writing code to rotate the servo motor 180 degrees and reset it to its position using pulse-width modulation signals controlled by the MSP430 timers and registers. The students successfully implemented the project and learned about applications of servo motors.

Uploaded by

Soham Khadke
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 6

K. J.

Somaiya College of Engineering, Mumbai-77


(A Constituent College of Somaiya Vidyavihar University)
Department of Electronics and Telecommunication
Engineering

Batch: A2 Roll No.: 16010320032


Experiment / assignment / tutorial No._11_
Grade: AA / AB / BB / BC / CC / CD /DD

Signature of the Staff In-charge with date

TITLE: Mini project MSP430 with Servo Motor


AIM:
OUTCOME: Students will be able to apply programming skills to develop application using
MSP430/LPC 2148

Team Members of Group:


Name of Member Roll Number
Kashish Gada 16010320019
Soham Karle 16010320028
Soham Khadke 16010320032

Software requirement: Code Composer Studio

Hardware tool:
 MSP430G2 launchpad
 Servo (SG90) Motor
 Jumper Wires

Abstract:
A servo consists of a Motor (DC or AC), a potentiometer, gear assembly, and a
controlling circuit. First of all, we use gear assembly to reduce RPM and to increase
torque of the motor. Servo motor is controlled by PWM (Pulse with Modulation)
which is provided by the control wires. There is a minimum pulse, a maximum pulse
and a repetition rate. Servo motor can turn 90 degree from either direction form its
neutral position. The servo motor expects to see a pulse every 20 milliseconds (ms)
and the length of the pulse will determine how far the motor turns. For example, a
1.5ms pulse will make the motor turn to the 90° position, such as if pulse is shorter
than 1.5ms shaft moves to 0° and if it is longer than 1.5ms than it will turn the servo to
180°.

Some Applications of Servo Motor:

Department of Electronics and Telecommunication Engineering


Page No Advanced Microcontroller lab V/July-Dec 2020
K. J. Somaiya College of Engineering, Mumbai-77
(A Constituent College of Somaiya Vidyavihar University)
Department of Electronics and Telecommunication
Engineering

 Used as actuators in many robots like Biped Robot, Hexapod, robotic arm etc..
 Commonly used for steering system in RC toys.
 Robots where position control is required without feedback.
 Less weight hence used in multi DOF robots like humanoid robots.

Block diagram:

Department of Electronics and Telecommunication Engineering


Page No Advanced Microcontroller lab Sem V July- Dec
2022
K. J. Somaiya College of Engineering, Mumbai-77
(A Constituent College of Somaiya Vidyavihar University)
Department of Electronics and Telecommunication
Engineering

Algorithm:

1. Start
2. Stop watchdog timer
3. Calibrate BCSCTL1 (Basic clock system control) register to 1Mhz
4. Calibrate DCOCTL (Digital Control Oscillator) register to 1Mhz
5. Setting sets the P1DIR to 01000001.
6. set the P1SEL as 1 for BIT6
7. In an infinite loop:
Start timer with 20ms period
for loop which goes from 350 to 2350 with increment of 1.
TACCR1 = i
TA0.1 in Reset/Set output mode
TACTL = TASSEL_2|MC_1;
Wait for 1.97 * 10^-5 sec
Wait for 1.94 * 10^-3 sec

Department of Electronics and Telecommunication Engineering


Page No Advanced Microcontroller lab Sem V July- Dec
2022
K. J. Somaiya College of Engineering, Mumbai-77
(A Constituent College of Somaiya Vidyavihar University)
Department of Electronics and Telecommunication
Engineering

Source code:
#include <msp430.h>
int i;
void main(void)
{
WDTCTL = WDTPW | WDTHOLD; // stop watchdog timer
BCSCTL1= CALBC1_1MHZ;
DCOCTL = CALDCO_1MHZ;
//PWM period
P1DIR |= BIT6;
P1SEL |= BIT6; //selection for timer setting
while(1) {
TACCR0 = 20000; //PWM period
for (i=350; i<=2350; i++) {
TACCR1 = i;
TACCTL1 = OUTMOD_7; //CCR1 selection reset-set
TACTL = TASSEL_2|MC_1; //SMCLK submain clock,upmode
__delay_cycles(1000);
}
__delay_cycles(1000000);
}}

Procedure:
1. Open Code Composer Studio and create a new project
2. Write the C program and save it with appropriate name
3. Build the program
4. Debug the program

Department of Electronics and Telecommunication Engineering


Page No Advanced Microcontroller lab Sem V July- Dec
2022
K. J. Somaiya College of Engineering, Mumbai-77
(A Constituent College of Somaiya Vidyavihar University)
Department of Electronics and Telecommunication
Engineering

Observation: (Copy the screen shot for each program)

Department of Electronics and Telecommunication Engineering


Page No Advanced Microcontroller lab Sem V July- Dec
2022
K. J. Somaiya College of Engineering, Mumbai-77
(A Constituent College of Somaiya Vidyavihar University)
Department of Electronics and Telecommunication
Engineering

Conclusion: We have learned the working principle of Servo Motor and saw it’s
implementation with Msp430 using Code Composer Studio Software. We wrote the code for
servo for rotating 180* and resetting to its position in smooth manner. We also rotated the
servo for other angles. We discussed various other applications of this project in other fields.

Signature of faculty in-charge with date

Department of Electronics and Telecommunication Engineering


Page No Advanced Microcontroller lab Sem V July- Dec
2022

You might also like