Experiment 2 procedure

Experiment 2 procedure
Experiment2
IntroductiontotheMSP430Microcontroller
ECEN4517/5517
Spring2014
The purpose of this experiment is to familiarize yourself with the MSP430
Microcontroller, so that later this semester you can implement maximum power
point tracking algorithms in a dc–dc converter, and so that you can control an
inverter to produce a sinusoidal output. You will use the Code Composer Studio
tools to write programs that control the digital and timer/PWM outputs, and in a
later experiment you will use the A/D converter. Finally, you will implement
circuitry that causes a power MOSFET to switch at a duty cycle programmable
withintheMSP430.
PowerLabMSP430F5172DevelopmentBoard
Your group should purchase a parts kit from the ECEE electronics store. This kit
includes a Development Board containing a Texas Instruments MSP430F5172
25MHz microcontroller, with on‐board 3.3 V regulator, LED, and JTAG port. All
partshavealreadybeensolderedontotheboard.
Therearetwowaystoconnectthedevelopmentboardtoacomputer:(1)usingan
MSP‐FET430UIF JTAG debug interface box, or (2) a TI Launchpad board. Your TA
willinstructyouwhichofthesetwooptionstotakeandwillprovidetheappropriate
cables:
(1) MSP‐FET430UIFJTAGdebuginterfaceboxplugsbetweenaUSBportofyour
labcomputerandtheJTAGconnector(JP1)oftheDevelopmentBoard.
(2) The Launchpad also connects to a USB port of your lab computer, but
requiresfourjumperwirestobeconnectedbetweentheLaunchpadandthe
Development Board. Please see detailed instructions in the “TI Launchpad”
linkedtotheExp.2coursewebpage.
The Development Board can be powered from an external dc power supply (any
valuefrom5Vtoover15Vwillwork)orfromtheJTAGconnector;ajumper(J5)
(whichyoushouldadd)selectsthis.TheUSBportsofthelabcomputersarecapable
ofsupplyingtherequiredpowerviatheJTAGconnector,butwhenoperatingyour
Exp.3systemyouwillwanttoderivethispowerfromanexternalbenchorPVcart
dcpowersupply.
Youwillalsoneedtoaddtwootherjumpers:(1)ajumper(J7)thatconnectstheon‐
boardLEDtopinP1.0,and(2)ajumper(J10)thatselectsthedigitalI/Ovoltageto
either3.3Voranexternally‐supplied5V—installthejumpertousetheboard3.3V.
AschematicoftheDevelopmentBoardislinkedtotheExp.2coursewebpage.
Task1.CodeComposerStudio,blinkingLED
ThelaboratoryWindows7computersincludethedevelopmentsystem:
CodeComposerStudioversion5.5
Log into your lab computer, and start the Code Composer Studio program. If the
program asks for a license, choose the free CODE SIZE LIMITED version. If the
welcomepagecomesup,clickon“StartusingCCS”.Thenchoosethemenuitem:
File>New>CCSProject
Enteraprojectname.Createadirectoryinsidethe“temp”directoryonyourC:drive
oronyourZ:drive,andenterthislocationinthewindow(notethatifyouusetheC:
drive,thisdatawillbeerasedwhenyoulogoffofthecomputer).Selectthe“MSP430”
Family, “MSP430x5xx Family” and “MSP430F5172” variant. Don’t change other
menusettings,andclickthe“Finish”button.Adefault“main.c”editwindowopens
upasshownbelow,andyouarenowreadytobegincoding:
#include <msp430.h>
/*
* main.c
*/
int main(void) {
WDTCTL = WDTPW | WDTHOLD; // Stop watchdog timer
}
return 0;
Notethatthefirstexecutablelinewithinyourmainprocedureisthecodetodisable
thewatchdogtimer.Thislineshouldbeincludedinthemainfileofallyourprojects.
EnterthecodediscussedinLecture2forblinkingtheLED,thensavethefile.Note
that the LED is connected to pin 1.0, so it will be necessary to modify the code so
thatitoutputstothecorrectpin.Youcannowcompileandlinkyourcodeusingthe
followingmenucommand(orclickonthebuild button):
Project>BuildAll
If there are no errors, your code is ready to be uploaded into your development
board.Startthedebuggerusingthefollowingmenucommand(orclickonthedebug
button):
Run>Debug
If an ultra‐low‐power advisor window pops up you can select “Do not show this
message again” and Proceed. This should load the program into the MSP430. If
Windows does not recognize the JTAG programmer or the Launchpad, it may be
necessary to add this device manually. The driver for the JTAG debug interface
board(MSP‐FET430UIF)shouldbeonthelocalC:driveinsidetheTexasInstrument
programfolder.
TostartexecutionoftheprogramontheDevelopmentBoard,clickonthegreenrun
button ,orusethepulldownmenu:
Run>Resume
Ifyouwanttomakechanges,clicktheredstopbutton,typeyourchanges,andsave.
Thenrepeattheprocessofuploadingandrunningtheprogram.
DemonstrateyourblinkingLEDprogramtoyourTA,andasktheTAtorecordthat
youhavecompletedTask1.thispart.(initialtheattachedscoresheet.
Task2.PulseWidthModulation
Createanewworkspacedirectoryusingthecommand
File>SwitchWorkspace…
Create a new workspace directory within the temp directory. After the program
restarts, edit the CCS project settings and create a new .c file, as described
previously.
EnterandmodifythepostedontheExp2pagetocauseTimerDtooutputaPWM
signal having a duty cycle of 36% and a switching frequency of 80 kHz. Operate
Timer D with a clock frequency equal to 200 MHz, so that Timer D has a time
resolutionequalto4ns.Connectanoscilloscopetoviewthewaveform,anddebug
asnecessary.Whenthisworks,getyourTAtorecordthatyouhavecompletedTask
2.
Task3.DrivingaPowerMOSFET
Thoroughlyreadtheremainderofthisproceduredocumentbeforeproceeding.
TheMSP430isunabletodirectlysupplythevoltageandcurrentrequiredtodrive
thegateofapowerMOSFET.ThepartskitcontainsaTC4428gatedriverICcapable
of producing gate currents of1.5A, and of shifting voltage levelsfrom 3.3 Vup to
12‐15V.
ConnectoneofthelowvoltagepowerMOSFETs(HUF75321)inyourpartskitona
breadboard. The MOSFET source should be connected to ground, and the drain
should be connected through a power resistor to the 0–35 V bench power supply
through a power resistor. You should choose the power resistor value and bench
supplyvoltagesothattheMOSFETdraincurrentisapproximately0.5Awhenthe
MOSFET conducts. Be careful to bypass the bench supply voltage on your circuit
board,asdiscussedbelow.
MounttheTC4428onthebreadboard,neartheMOSFET.Connectthenoninverting
driveroftheTC4428betweentheMSP430outputpinandtheMOSFET.Besureto
bypassthepowersupplyofthegatedriverICwithaceramiccapacitor,mountedas
closeaspossibletothepowersupplyandgroundpinsoftheIC.TheTC4428should
besuppliedbythelabbench12‐15Vpowersupply.Itisstronglysuggestedthatyou
usetwistedpairstoconnecttheMOSFETgateandsourcetothedriverIC,andalsoa
twistedpairtoconnecttheMSP430anditsgroundpintothedriverIC.
Connect the oscilloscope 10:1 voltage probes to measure the voltages at the gate
anddrainoftheMOSFET.Measuretheriseandfalltimesofthegate‐to‐sourceand
drain‐to‐sourcevoltagewaveforms,aswellastheturn‐onandturn‐offdelaytimes
of the MOSFET. Compare the duty cycles of the MSP430 code vs. the measured
drain‐to‐sourcevoltage.DemonstrateyourworkingcircuittoyourTA,andhavethe
TArecordthatyouhavecompletedTask3.
This experiment does not require a written report; instead, the TA will enter the
scoreonD2Lbasedoncompletionoftheexperimenttasks.
Notesonconstructionanddebuggingofpowerelectroniccircuitry
Supplyvoltagedecoupling
In all circuits, especially those that produce pulsating waveform, decoupling
capacitorsareessentialtoensurethatthedcsupplyvoltageisundisturbedbylarge
current transitions and spikes, and to prevent propagation of noise through the
power distribution circuitry. Without decoupling capacitors, current spikes and
transitionscancauselargevoltagetransientsandoscillationsonthepowersupply
wires,becauseoftheinductanceofthewiring.Suchvoltage“spikes”and“ringing”
candisruptoperationofalldevicesconnectedtothepowersupply.
Itisnecessarytoensurethatadequatecapacitorsareincludedinyourcircuitryfor
powersupplydecoupling.Herearesomesuggestions:

Between the positive supply and ground terminals of the controller circuit
board, connect an electrolytic capacitor of at least 10 µF (in the case of a
power converter circuit board, a considerably larger capacitance may be
required). This capacitor filters low‐frequency variations in the power
supply. Note that this electrolytic capacitor is polarized; connecting it to a
powersourcewiththewrongpolaritywillcausethecapacitortofail.

For all integrated circuits on thecontrollerboard, a ceramic capacitor of at
least0.1µFshouldbeconnectedbetweeneachpowersupplypinandground
pin, as close as possible to the chip. This capacitor filters high‐frequency
variationsinthepowersupply.Gatedrivercircuitryoftenrequiresadditional
high‐frequencydecouplingcapacitance,perhaps1µFormore.
Constructinganddebuggingtestcircuits
Donotforgettopowerdownthecircuitbeforeyoumakeanyadditionsorchanges
to the circuit. This is especially important in later experiments that drive the
converter power stage. Turn on the power only after you have checked that your
connectionsarecorrect.Inparticular,alwayscheckthepolarityofthepowersupply
connectionstothechips.
Ifyourcircuitdoesnotwork,itissuggestedthatyoutroubleshootitinasystematic
manner.Usetheoscilloscopetoviewthevoltagewaveformsateverypinofthefirst
chip,beginningwithitsinput.Aretheyasyouexpect?Ifnot,thenyouhavelocalized
theproblem.Whentheoperationofthefirstchipiscorrect,thenrepeattheprocess
forthenextchip.
Experiment2
IntroductiontotheMSP430Microcontroller
ECEN4517/5517
Scoresheet
Namesofgroupmembers: Task
TAInitials
1.DemonstrationofblinkingLED
2.DemonstrationofPWMoutputhaving
D=36%andfs=80kHz,with
TimerDresolutionbetterthan10ns
3. Demonstration of MOSFET driven by
MSP430PWMoutput
Was this manual useful for you? yes no
Thank you for your participation!

* Your assessment is very important for improving the work of artificial intelligence, which forms the content of this project

Download PDF

advertisement