You are on page 1of 84

RoboSapien Powered by MSP430

Pedro Dinis Gaspar, António Espírito Santo,


Humberto Santos, Bruno Ribeiro
Engineer/Assistant Professor

Tiago Godinho, Filipe Martins, Luís Costa


Last year Electromechanical Engineering Students
Slide 1
Agenda
• MSP430@UBI-DEM:
ƒ Electromechanical engineering classes and,
ƒ Last year projects

• Electromechanical Engineering classes - Robotics:


ƒ RoboSapien powered by MSP430

• Last year projects:


ƒ Sounds Recording and Reproduction System based in
MSP430 for the RoboSapien

• Summary

Slide 2
MSP430@UBI-DEM
• The MSP430 microcontroller family is used in the
Electromechanical Engineering Department of the
University of Beira Interior (DEM-UBI) – Portugal in:
ƒ Electromechanical engineering classes and,
ƒ last year projects

• Due to:
ƒ its cost;
ƒ plenty of hardware starter kits and software integrated
development environments either free or with a reduced cost;
ƒ Amount of peripherals integrated in the μC;
ƒ rapid learning curve;
ƒ low power features;
ƒ high pinout counting;
ƒ C and C++ easy programming.
ƒ Among others… Slide 3
MSP430@UBI-DEM
• Electromechanical Engineering classes
• Introduction to Microprocessors:
ƒ Description of the various systems embedded in a microcontroller;
ƒ Architecture characteristics;
ƒ Memory Hierarchy;
ƒ Internal modules;
ƒ Input/Output ports;
ƒ Peripherals;
ƒ Programming language Assembler / C;
ƒ Arithmetic;
ƒ Communications networks.

• All these topics use MSP430 as example


• Laboratorial classes demonstrating its capabilities
Slide 4
MSP430@UBI-DEM
• Electromechanical Engineering classes
• Instrumentation and Data Acquisition (Lab examples):
ƒ MSP430 Monitoring System - Develop a low cost system for
event record.
LED’s LCD

Light Signal
sensor conditioning
I/O

Signal
Tilt sensor
conditioning

I/O
I/O
Buttons USART

PC data transmission

PCB board routing Slide 5


MSP430@UBI-DEM
• Electromechanical Engineering classes
• Automation (Lab examples):
ƒ MSP430 home heating, illumination and security control.

Light
sensor Comparator Relay Heating
Indoor

ADC
Light
Relay Motor
sensor Comparator

I/O
Outdoor

Motor Speed
Temperature LCD Controller and Direction Light
Sensor Control

S
Development board Indoor light sensor Slide 6
MSP430@UBI-DEM
• Electromechanical Engineering classes
• Robotics (Lab examples):
ƒ MSP430 control board and software for the FESTO robot.
LED’s Buttons

I/O

End
Optical

ADC
course

I/O
Photocouplers Optical
switch Drivers
Photocouplers

Position
Comparator USART
Sensor

MOTOR

Rotational optical sensor Linear optical sensor for longitudinal movement Slide 7
MSP430@UBI-DEM
• Electromechanical Engineering classes - Robotics:

ƒ 2006 Project - RoboSapien powered by TI MSP430;

ƒ Born by the collaboration between DEM-UBI and TI;

ƒ Substitution of RoboSapien’s control/regulation


electronics;

ƒ Replicate the RoboSapien operation;

ƒ Evidencing the capabilities of TI MSP430;

ƒ To motivate the students and to develop a technology


demo "vehicle".
Slide 8
RoboSapien powered by MSP430
• The tasks involved in the project consisted in the:

(1) analysis of the robot dynamics (evaluation of the robot


movements and its characteristics);

(2) analysis of all sensor/actuator devices on the robot and


respective signal conditioning and regulation
electronics;

(3) development of the hardware (PCB boards and


electronics) and software (C code for the controlling
program in the MSP430 to commit robot dynamics); and

(4) tests and development of new functionalities.

Slide 9
Who is RoboSapien?
• RoboSapien (RS) is a toy-like biomorphic robot.

• Is preprogrammed with moves, and also controlled by an


IR remote control;
Original RoboSapien

• It is capable of:
ƒ a walking motion;
ƒ grasp objects with either of its hands
ƒ throw grasped objects with mild force;

• It has a small loudspeaker unit, which can broadcast


several different vocalizations.
Slide 10
Who is RoboSapien?
• A brief presentation of the RoboSapien operation.
Original RoboSapien

Slide 11
Who is RoboSapien?
• RoboSapien views.
Frontal view, seven motors move the robot. Side view.

Slide 12
Who is RoboSapien?
• Dynamic walking gait of RoboSapien.
(1) The trunk motor tilts the upper body to the right. The center of
mass shifts over the right foot. The left foot lifts from the
ground.
(2) The leg motors move into opposite directions, resulting in a
forward motion of the robot. As the upper body swings back,
the left foot regains contact with the ground.
(3,4) Symmetrical to (1,2).

Slide 13
Programming of the RoboSapien
• The RS controller, is equipped with a basic level of
programmability.

• Users can string together movement commands to form


Original RoboSapien

either macros or mini-programs (instructions sets).

• Broadcast of an instruction-set to the RS, save it on-


board memory for later execution.

• Sensor-keyed instruction set, performing a specific set of


actions on contact with a specific sensor system.

Slide 14
RS’s Remote Control
• The RS’s remote control unit has 21 different buttons.
With the help of two shift buttons, 67 different robot-
executable commands are accessible.
Bulldozer Burp Right pick up
Fart (Oops) High Five Right strike 1
Original RoboSapien

Left arm down Left arm in Right strike 2


Left arm out Left arm up Right strike 3
Lean back Lean forward Right (turn right)
Lean left Lean right Step backward
Left pick up Left strike 1 Step forward
Right throw Left strike 2 Right sweep
Left sweep Left strike 3 Right thump
Left thump Left throw Roar
Talk back Walk forward Whistle
Turn step right Dance Demo 1
Walk backward Demo2 All Demo
Reset Left (turn left) Stop
Right arm in Right arm down Turn step left
Right arm up Right arm out Wake up Slide 15
RS eye patterns
• Depending on the command that is executed, the RS’s
eyes have different patterns.
• The 6 outputs for the eyes (P2.0 to P2.5) can be used as
a very effective digital-level feedback source. His eyes
Original RoboSapien

give distinct patterns for all conditions.

Slide 16
User modifications
• Some words of the Robot Tech Support, from WowWee Ltd.

“The RoboSapien is designed for modification. Here is the


short hint list for the budding RS hacker.
Original RoboSapien

First off, we must warn you that completely replacing


the RS brain should only be attempted by those with
a lot of time, electronic skills, and programming ego.

You don’t have to though — if you carefully remove the


connectors and lift the RS motherboard, on the back you
will find all inputs and outputs labeled, and right next to
gold pads convenient for soldering wires.”

in http://www.robosapien1.com/resources/official-mod-guide/
Slide 17
User modifications
• Mark Tiden designed the RS to be easily modified or
hacked;

• The electronics inside the RS are easily accessed and


Original RoboSapien

clearly labeled;

• A growing community of hackers have devoted


themselves to adding new functionalities to the robot.

Slide 18
User modifications
• microbi’s Robosapien mods (http://www.angelfire.com/droid/rsv2/)
• Active mods: hand-beams, hand-Led’s, heartbeat, voice
off, tunnel-beam, blue EYES
Original RoboSapien

• Robosapien RF Sound Mod (http://home.comcast.net/~robosapien/rfmod.htm)


Robosapien Camera Mod (http://home.comcast.net/~jsamans/robo/robocam.htm)
• Active mods: wireless camera;
wireless radio; frequency audio;
pc control.

Slide 19
User modifications
• RoboSapienPets RoboSapien page (http://www.aibohack.com/robosap/)
• Active mods: SuperSapien microcontroller mod,
color and motion tracking CMUCam
Original RoboSapien

• Mark C’s Robosapien Hacking Site


(http://homepages.strath.ac.uk/~lau01246/robot/myhackrs.shtml)

• Active mods: microcontrollers (PicMicro


controllers, and Palm Pilot controllers for
the Robosapien)
Slide 20
User modifications
• Robocup German Open 2005 tournament;
• 2 teams of 3 RSs each played the 1st soccer match of
humanoid robots worldwide;
• Head replaced by a PDA allowing the perception of its
Original RoboSapien

environment using the camera;


• Information sended though the PDA's IR, to a PC.

Slide 21
Controller U2
• M means motors,
• P means input or output port,
• VDD is raw battery voltage (caution: fluctuates wildly)
Original RoboSapien

• Vcc is regulated 3.6V and Gnd is universal ground.

Slide 22
Controller U2 - Connections
Left shoulder Right Shoulder
Motors
M2- M2+ Vcc P1.3 P1.6 Vcc M4- M4+
Original RoboSapien

Slide 23
Controller U2 - Connections
Left shoulder Shoulder position switch Right Shoulder
M2- M2+ Vcc P1.3 P1.6 Vcc M4- M4+
Original RoboSapien

Slide 24
Controller U2 - Connections
Left elbow Right elbow
P1.2 Motors M3+
Vcc M3-
Vcc Vcc
Original RoboSapien

P1.1 P2.7
P2.6 P1.4
Vcc Vcc
M1+ Vcc
M1- P1.5

Slide 25
Controller U2 - Connections
Left elbow Right elbow
P1.2 Finger switch M3+
Vcc M3-
Vcc Vcc
Original RoboSapien

P1.1 P2.7
P2.6 P1.4
Vcc Vcc
M1+ Vcc
M1- P1.5

Slide 26
Controller U2 - Connections
Left elbow Right elbow
Elbow position switch
P1.2 M3+
Vcc M3-
Vcc Vcc
Original RoboSapien

P1.1 P2.7
P2.6 P1.4
Vcc Vcc
M1+ Vcc
M1- P1.5

Slide 27
Controller U2 - Connections
Left elbow Right elbow
Arm LEDs
P1.2 P1.5
Vcc Vcc
Vcc Vcc
Original RoboSapien

P1.1 P1.4
P2.6 P2.7
Vcc Vcc
M1+ M3-
M1- M3+

Slide 28
Controller U2 - Connections
Left leg/hip Right leg/hip
Motors
M6+ M7-
M6- M7+
Original RoboSapien

Tilt
M5+
M5-

Slide 29
Controller U2 - Connections
Head
Vcc P2.0 P2.1 P2.2 P2.3 P2.4 P2.5 IR-OUT Gnd Vrx
Original RoboSapien

Left eye LEDs

Slide 30
Controller U2 - Connections
Head
Vcc P2.0 P2.1 P2.2 P2.3 P2.4 P2.5 IR-OUT Gnd Vrx
Original RoboSapien

Right eye LEDs

Slide 31
Controller U2 - Connections
Component Speakers
Vcc VDD Vcc P1.4 SPK1 SPK1 IN OUT Fr VDD Fr

Component
Original RoboSapien

P1.1 Vcc Gnd Vcc

Slide 32
Controller U2 - Connections
Component Foot switch Speakers
Vcc VDD Vcc P1.4 SPK1 SPK1 IN OUT Fr VDD Fr

Component
Original RoboSapien

P1.1 Vcc Gnd Vcc

Slide 33
Original RoboSapien Controller U2

Slide 34
Original RoboSapien Controller U2

Slide 35
Original RoboSapien Motor driver U3

Slide 36
IR commands
• To input commands is used the direct serial input to the
IR-OUT pin (active low signals, 1200 bps).

• Timing based on 1/1200 second clock (~ 0,833 msec)


Original RoboSapien

Signal is normally high (idle, no IR).

• Data bits: for each of 8 data bits, space encoded signal


depending on bit value (Sends the most significant data
bit first). (Carrier is 39,2 kHz)

• BTW: The first bit (msb) is always 1 (valid codes are from
0x80 to 0xFF)
Slide 37
IR commands
• Header: signal goes low for 8/1200 sec.
• If the data bit is 0: signal goes high for 1/1200 sec, and
low for 1/1200 sec.
• If the data bit is 1: signal goes high for 4/1200 sec, and
Original RoboSapien

low for 1/1200 sec.


• Example: Command Stop: 0x8E

Slide 38
RoboSapien Replication
• The RS has the following devices and sensors:
Electromechanical engineering classes - Robotics

ƒ IR receiver;
ƒ Power switch;
ƒ Microcontroller;
ƒ Seven motors (hands, arms, feet and hip);
ƒ Four foot touch sensors;
ƒ Two hand touch sensors,
ƒ Sound sensor;
ƒ Seven LEDs;
ƒ An external IR remote control.

Slide 39
Signal Analysis
• Digital signals acquired from the electronic board ports;
Electromechanical engineering classes - Robotics

• To know how the microcontroller work when the robot do


a specific command function.

• The procedure consisted in the acquisition of the ports


digital signals:

ƒ for a single motor,

ƒ related to command functions that combine several


movements at the same time. Slide 40
Signal Analysis
• For the single movements we’ve used a Tektronix™
Electromechanical engineering classes - Robotics

TDS220 oscilloscope.
• For the robot combined movements, a PM3580 Logic
Analyzer was used.

Slide 41
Single motor signal graphics
• Illustration of the output signal from the original
Electromechanical engineering classes - Robotics

microcontroller and the signal that the motor receives.

output signal vs. Motor input signal Left elbow movement


from the inside to outside and vice-versa
Slide 42
Combined motors graphics
• Wires connected to the original microcontroller ports:
Electromechanical engineering classes - Robotics

ƒ In order to connect it to a flat cable to measure the combined


movements digital signals using a logic analyzer.

• Acquisition of the graphical digital signals for the


microcontroller motor ports:
ƒ For all the combined functions defined in the remote control.

• Graphic functions only obtained for a side function


movement of the robot:
ƒ Since other side does the same movements with opposite motors.

Slide 43
Combined motors graphics
• Example: Output Ports Signals for the function “Oops”.
Electromechanical engineering classes - Robotics

• Signal “M1+” (Left Elbow Out) is “high”, for 531 msec and
the rest of the time (2125 msec) is “low”.
• Signal “M3+” (Right Elbow Out) presents the same signal.
• Both elbows executes the movement at the same time.

Slide 44
New RS Brain – MSP430
• Removal of the original microcontroller from the RS
Electromechanical engineering classes - Robotics

electronic board.

• Flat cables were used to wire the


electronic board to the kit Olimex
MSP430F449-STK2 to test the motors.
Slide 45
MSP430 I/O functions
Label MSP430F449 Ports Motor Function
Electromechamical engineering classes - Robotics

M1+ P6.0 Left Elbow Elbow goes out, and opens gripper
M1- P6.1 Left Elbow Elbow goes in, and closes gripper
M2+ P6.2 Left Arm Arm goes up
M2- P6.3 Left Arm Arm goes down
M3+ P6.4 Right Elbow Elbow goes out, and opens gripper
M3- P6.5 Right Elbow Elbow goes in, and closes gripper
M4+ P6.6 Right Arm Arm goes up
M4- P6.7 Right Arm Arm goes down
M5+ P2.0 Hip Left leaning
M5- P2.1 Hip Right leaning
M6+ P2.2 Left Foot Foot goes back
M6- P2.3 Let Foot Foot goes forward
M7+ P2.4 Right Foot Foot goes back
M7- P2.5 Right Foot Foot goes forward Slide 46
Hardware - PCB board
• Microcontroller: MSP430F149;
Electromechanical engineering classes - Robotics

• Resources:
ƒ Motors: P6.0 – P6.7 , P2.0 – P2.5;
ƒ LEDs: P4.0 – P4.7;
ƒ IR: P1.1;
ƒ Switches: P1.2 – P1.3;

Slide 47
Hardware - PCB board
+3.3

P1 R1
TDO/TDI 47K C15 +3.3
Electromechanical engineering classes - Robotics

1 2
TDI
3 4 +3.3
TMS
5 6 10nF R2
TCK
7 8 330R
9 10
RST/NMI P5
11 12
P14
13 14 4
P13
DS1 3
Header 7X2 P12
LED3 2
P11/IR

RST/NMI

TDO/TDI
1

XT2OUT
XT2IN
Switch

TMS
TCK

TDI
P62
P61
P60
P6
+3.3 LED8

64
63
62
61
60
59
58
57
56
55
54
53
52
51
50
49
C4 C3 8
LED7
10uF 100n 7
LED6
6

AVcc
DVss
AVss
P6.2/A2
P6.1/A1
P6.0/A0
RST/NMI

TDO/TDI
TMS

P5.6
P5.5
TCK

XT2OUT
P5.7
TDI/TCLK

XT2IN
LED5
5
1 48 LED4
DVcc1 P5.4 4
P63 2 47 LED3
P6.3/A3 P5.3 3
P64 3 46 LED2
P6.4/A4 P5.2/SOMI1 2
P65 4 45 LED1
C1 P6.5/A5 P5.1/SIMO1 1
12pF P66 5 44
P6.6/A6 P5.0/STE1
P67 6 43 P47 LED
P6.7/A7 P4.7/TB7
7 uP1 42 P46
VREF+ P4.6/TB6
8 MSP430F149 41 P45
XIN P4.5/TB5
2

1 9
XOUT P4.4/TB4
40 P44 P4
Y1 10 39 P43 P67
VeREF+ P4.3/TB3 8
85SMX 11 38 P42 P66
VREF-/VeREF- P4.2/TB2 7
12 37 P41 P65

P2.2/CAOUT/TA0
P1.0/TACLK P4.1/TB1 6

P2.6/ADC12CLK
13
P11/IR 36 P40 P64

P2.1/TAINCLK
P1.1/TA0 P4.0/TB0 5
3

P2.3/CA0/TA1
P2.4/CA1/TA2
P1214 35 P63
P1.2/TA1 P3.7 4

P3.2/SOMI0
P3.1/SIMO0
P2.0/ACLK
P1315 34 P62

P3.0/STE0
P1.3/TA2 P3.6 3

P2.5/Rosc

P2.7/TA0
P1416 33 P61
C2 P1.4/SMCLK P3.5 2
12pF P60
1

P1.5
P1.6
P1.7

P3.3
P3.4
Motores1
P3

17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
P2 +3.3 P25
6
P24
2 C5 C6 5
P23

P20
P21
P22
P23
P24
P25

P30
P31
P32
P33
1 100n 10uF 4
LED7 P22
3
LED3 LED5 P21
2
LED1 P20
R9 Q7 1
P46
P42 R5 Q3 P44 R7 Q5 BC847 Motores 2
P40 R3 Q1 BC847 BC847
4K7
BC847
4K7 4K7
4K7

LED8
LED2 LED4 LED6

P41 R4 Q2 P43 R6 Q4 P45 R8 Q6 P47 R10 Q8


BC847 BC847 BC847 BC847
4K7 4K7 4K7 4K7

Slide 48
Electromechanical engineering classes - Robotics Hardware - PCB board

Slide 49
Software – Operations Principle
Timers
[0] [1] [2] [3] [4] [13] [14]
Electromechanical engineering classes - Robotics

[0] 2643 425 0 0 0 0 0 1 0


Example: M1 state 0
M1+
Motor 1
M1- [1] 525 531 319 1693 0 0 0 1 1
[2] 0 0 0 0 0 0 0 0 0

If M1+ = High & M1- = Low


Motors

[12] 0 0 0 0 0 0 0 0 0 then, M1 runs counter


[13] 0 0 0 0 0 0 0 0 0
clockwise
Motor State
Motor Initial Value

M1+, M1- are logical motors;


Both represent the physical motor M1;

Note: M1+, M1- can’t possess the


same high state (short circuit)
Slide 50
Electromechanical engineering classes - Robotics Software – Architecture

Slide 51
Software – Background task
BackGround Task Flow Chart
Electromechanical engineering classes - Robotics

Start

Initialization

No
Any
Command?

Yes

Decode
Command

Load Command
Action

Slide 52
Software – System task System Task Flow Chart

Start
Electromechanical engineering classes - Robotics

Movement
No
On ?

Motor (M1+)
Motor (...) Yes
Motor
No (M7-)
Motor (n)
Enable
Motor (n)
No Switch On? No
Enable
Motor (n)
No
Yes Enable
Yes Get next
Yes
Decrement Timer (n)
Get next
Yes
Timer (n)
Decrement Timer (n)
Get next
Timer (n) Debounce
Decrease Timer (n)
Timer (n)
Timer (n) = 0? Yes
Timer (n) = 0?
No Timer (n) = 0?
No Timer (n) = 0? Timer (n) = 0?
Yes
Switch On? No
No Timer (n) = 0? Yes
Yes Desable
Yes Motor (n) Yes
Desable Yes
Change Motor (n)
Yes
Motor (n)
Value
Desable
Change Motor (n) Motor (n) Put STOP
Value Command
Change Motor (n)
Value

END

Refresh all
Motors value

Put Next Movement


No
Command ON ?

Slide 53
Software – IR command task
Commad IRS State Machine

Inicialization
Electromechanical engineering classes - Robotics

Comunication OFF

Signal : Higth to Low

Clear TBR
Preamble NOT valid
Capture on rising edge
Timeout Condition

Clear TBR
Capture on falling edge Validate
Initialize data Preamble

Preamble is valid

Clear TBR
Capture on falling edge
Valid Commad Initialize data

Clear TBR
Capture on falling edge
Initialize data Communication On
Put command in the ring buffer Signal Higth

Timeout Condition

Clear TBR
Capture on falling edge
Initialize data Slide 54
Project conclusions
• Successful attempt in the substitution of RoboSapien
Electromechanical engineering classes - Robotics

control/regulation electronics by TI MSP430;

• Excellent demo vehicle of technology;

• Use the RoboSapien in laboratorial classes, as a way to


demonstrate the embedded systems capabilities;

• With MSP430, the RoboSapien has a potential evolution


capability.

Slide 55
Future work
• Include wireless communications like ZigBee;
Electromechanical engineering classes - Robotics

• Expand computation capabilities (TI C2000) to include


voice commands;

• Development of a user friendly PC high level application


to perform new actions/movements;

Slide 56
MSP430@UBI-DEM
• Last year projects

• Sounds Recording and Reproduction System based


in MSP430 for the RoboSapien
Last Year Projects

• Implementation of a system of sounds with the


particularity to reproduce the voice signal data, stored in
flash memory by:
• PWM outputs available in the MSP430F449.
• A digital to analog converter TI TLV5616CP.
• The comparison between the methods give clear
advantage to the system that uses the external integrated
circuit.
Slide 57
PWM frequency
• The required frequency for the PWM output signal is
equal to the DAC actualization frequency.
Last Year Projects

• Each alteration in the PWM duty cycle is equivalent to one


DAC sampling.

• Clock frequency: 8 MHz


• Resolution: 12 bits
• PWM frequency: 1953 Hz

Slide 58
Global Architecture of the system
• Application block diagram (Analog and digital blocks)
since the microphone to the speaker.
Last Year Projects

Slide 59
MSP430 used peripherals
• MSP430 Digital peripherals:
• ADC12,
• Timer_A and Timer_B,
• flash memory.
Last Year Projects

• The signal conditioning circuit of the microphone is


connected to channel 0 of the ADC12.

Slide 60
Important States
• 2 important states: Recording and Reproduction

• Recording state: 1st analog part and the digital one


actives.
Last Year Projects

• During this time period, the data converted by the ADC12


will be stored in the flash memory.

• Reproduction state: digital part and the 2nd analog part will
be actives.
• The voice signal is sent to the PWM output by TImer_B.
• A filter was developed to improve the PWM DAC signal,
which is amplified and sent to the speaker. Slide 61
Microphone and Conditioning system
• Pre-amplifying circuit and low pass filter
• Microphone: input jack 3,5 mm (J1)
• Amplifying stage: Active low pass filter (TI OA
TLE2141CP)
Last Year Projects

R4
+5V
56k
C3
+5V
R1 470p D1
1k1

7
8
C1 R3 2
6 R7 Liga ao canal 0
4.7u 1k1 3 IC1a do ADC12
R2 1 18k C4
680 5 TLE2141CP 10n
no MSP430F449
D2 (pino 95)

4
+5V

R5 R6
1 J1
2 27k 11k
4
5 C2
3
Microfone 4.7u

Slide 62
PWM DAC and active filter
• The PWM DAC is constituted by two RC series low pass
filters.

• The digital signal in the TIMER_B compare output is converted


Last Year Projects

to an analog signal.

• To reduce the attenuation amount of the signal produced by the


filter, the cut off frequency of the filter should be near the band
weight used at the ADC12 input.

• Cut off frequency: fcut off = 723 Hz

Slide 63
PWM DAC and active filter
• Before amplifying the signal, it is used an Sallen-Key low
pass filter with unitary gain.
• 2 resistors (R10 e R11),
• 2 condensers (C7 e C8)
Last Year Projects

• TI OA TLE2141CP with unitary gain (buffer)


ƒ Cut off frequency: fcut off = 870 Hz
ƒ Quality factor: Q = 1,97
C7
+5V
0.22u

7
8
Liga à saída R8 R9 R10 2 Liga ao
compare do 6 amplificador
1k 1M 1k8 R11 3 IC1b
Timer_B C6 1
de áudio
C5
no MSP430F449 0.22u 470p 18k 5 TLE2141CP
(pino 77)

4
C8
4.7n

Slide 64
Audio amplifier
• Volume control: tension divider (R12 and R13)
• Limit the input audio signal level.
• Amplifying circuit: Audio amplifier Philips TDA7052
Last Year Projects

+5V
C10

220u
C11

Liga à saída R12 IC2


do filtro 470k 100n 1 8
VP OUT2
2 7
Sallen-Key 3
IN NC
6
GND1GND2
C9 4 5 1 J2
NC OUT1
2
100n TDA7052 4
R13 R14 R15 5
330k 10k 10k 3
Headphone

Slide 65
Using MSP430F449 OLIMEX kit
• 3 external interfaces: JTAG, AEXT and EXT
• AEXT interface - ADC12
• EXT interface – Access to multiplexed ports.
Last Year Projects

Slide 66
PWM signals - Software
• Erasing flash memory by segments

Step Description
1 Stop Watchdog timer
Last Year Projects

2 Select clock source. f ≈ 444 kHz


3 Unblock flash memory
4 Set the erase mode by segments
5 Set to 0 the flash memory index which segment is to be erased
6 Unset the erase mode by segments
7 Block flash memory

Slide 67
PWM signals - Software
• Write words in flash memory

Step Description
1 Stop Watchdog timer
Last Year Projects

2 Unblock flash memory


3 Set the word writing mode
4 Attribute the memory index with a 16 bits data
5 Un set the word writing mode
6 Block flash memory

Slide 68
Storing voice signals - Software
• Flash memory used: 370 Kbytes
• Duration of speech: 15,3 sec
Last Year Projects

Slide 69
Using Timer_A - Software
• Speech signal sampling frequency: 1953 Hz = 512 μsec.

• Generate an interruption to save the speech signal


sample.
Last Year Projects

• Operation mode: up mode.

• Increase TAR until TAR = TACCR0 then generate interruption.

Slide 70
Using ADC12 - Software
• Conversion reference voltage: 0 – 3 V.

• Time of conversion: 5,8 μsec.


Last Year Projects

Slide 71
MatLab verification
• Word saved in flash memory: “hello”
Last Year Projects

Slide 72
Using Timer_B - Software
• PWM outputs each 512 μsec.

• Each signal sample stored in flash memory is sent to the


PWM DAC through Timer_B interruption.
Last Year Projects

• Operation mode: reset/set.

Slide 73
Serial communication DAC
• 2nd choice for the global architecture of the system.
• Substitution of the PWM DAC for a serial communication
DAC.
Last Year Projects

• Using the same peripherals but also the USART in SPI mode.
• Allows sending the serial data synchronized to the 12 bits DAC
(TI TLV5616CP).

Slide 74
Using USART - Software
• 2nd choice for the global architecture of the system.
• Substitution of the PWM DAC for a serial communication
DAC.
Last Year Projects

• Using the same peripherals but also the USART in SPI


mode.
• Allows sending the serial data synchronized to the 12 bits
DAC (TI TLV5616CP).
• In synchronous mode, the USART allows to connect the
MSP430 to an external device through: SIMO, SOMI,
UCLK and STE.
• For correct operation of the USART in SPI mode, the bit
SYNC in the UxCTL control register must be active. Slide 75
Serial communication DAC
• Using the Olimex kit MSP430F449, the connections are:
Last Year Projects

R4
+5V
56k
C6
+5V
R1 470p D1
1k1

7
8
C1 R3 2
6 R7 Liga ao
4.7u 1k1 3 IC1a pino
R2 1 18k C7
680 5 TLE2141CP 10n
15 de AEXT

4
+5V D2

R5 R6
1 J1
2 27k 11k
4
5 C2
3
Microfone 4.7u

Slide 76
Last Year Projects Serial communication DAC

Slide 77
Serial communication DAC
Liga ao Liga ao Liga ao
pino 1 pino 5 pino 4
de EXT de EXT de EXT

C4
+5V
IC2 0.22u

7
1 8 8
DIN VDD
2 7 R10 2
SCLK OUT
3 6 6
CS REFIN
4 5 1k8 R11 3 IC1b
FS AGND
R8 1
TLV5616CP 18k 18k 5 TLE2141CP

4
C8
Last Year Projects

4.7n

Liga ao C3
pino 7 R9 4.7u
18k
de EXT

+5V
C5

220u
C9

R12 IC3
470k 100n 1 8
VP OUT2
2 7
IN NC
3 6
GND1GND2
C10 4 5 1 J2
NC OUT1
2
100n TDA7052 4
R13 R14 R15 5
330k 10k 10k 3
Headphone
Slide 78
Last Year Projects Breadboard development

Upper connections Lower connections


Slide 79
Last Year Projects Breadboard development

Slide 80
Project conclusions
• Using PWM signals:
ƒ Low quality of the sound reproduced
ƒ Due to the sampling frequency (1953.125 Hz)
ƒ Speech duration: 15,3 sec
Last Year Projects

• Using serial communication DAC TLV5616CP


ƒ Higher quality of the sound reproduced
ƒ Speech duration: 3 sec

• To include this sound recording and reproduction system


in the RoboSapien, it is necessary to include an external
memory in MSP430 to increase the duration of the
speech. Slide 81
Project conclusions
• The voice commands recognition by the RoboSapien
needs:
ƒ Voice acquisition;
ƒ Parameters extraction;
Last Year Projects

ƒ Pattern recognition.

• Voice acquisition: ADC12.


• Parameterization algorithm: development of a software
code to extract the characteristics of the voice acquired, in
a manner of extraction commands interpretation through
their pattern.
• Pattern recognition: through successive comparisons with
a reference pattern. Slide 82
Summary
• Presentation of the teaching structure at UBI in classes
that use microprocessors;

• Exposition of the items covered in the substitution of the


RoboSapien microcontroller by TI MSP430, untitled
“RoboSapien powered by MSP430”;

• Presentation of last year degree projects using MSP430


as the “sound recording and reproduction system for the
Robosapien”.

Slide 83
Acknowledgments
• This project was partially funded by Texas Instruments;

• The authors would like to particularly acknowledge the


help provided by:

• Christian Speck
(TI Europe Business Development);

• Robert Owen
(TI University Programme Manager: Education &
Communications).
Slide 84

You might also like