Question: #include #include #include #include #include TM 4 C 1 2 3 GH 6 PM . h #include MyDefines.h void DelayMs ( int
#include
#include
#include
#include
#include TMCGHPMh
#include "MyDefines.h
void DelayMsint ms; Software Delay Function
void SegDisplayuintt d;
void SetupGPIOvoid;
You nave to finish the following array for Seven Segment Display
char SevenSegxf
x
You have to finish this array for seg display
;
int main
char ch ;
int i ;
Place your initializationstartup code here eg SetupGPIO
SetupGPIO;
while
Place your application code here
for i ; i sizeofSevenSeg; i
SegDisplaych & xF;
ch;
DelayMs;
void SegDisplayuintt d
char seg;
seg SevenSeg;
Device Port.Pins DIR DriveMode
Sega
Segb
Segc
Segd
Segf
Segg
Segdp
SW
SW
Port
void SetupGPIOvoid
Configure GPIOs
Enable Clock to the GPIO Modules SYSCTLRCGCGPIO PORTs;
SYSCTLRCGCGPIO ;
allow time for clock to stabilize SYSCTLPRGPIO & PORTs
whileSYSCTLPRGPIO & ;
Unlock GPIO only PD PF on TMCG; PD PE on TMCGPIOxLOCK xCFB; and GPIOxCR PINs;
GPIODLOCK xCFB;
GPIODCR PIN;
GPIODLOCK ;
GPIOFLOCK xCFB;
GPIOFCR PIN;
GPIOFLOCK ;
Set Analog Mode Select bits for each Port GPIOxAMSEL PINs; digital, analog
Set Port Control Register for each Port GPIOxPCTL PMCn PTCLPINn, check the PCTL table
Set Alternate Function Select bits for each Port GPIOxAFSEL PINs; regular IOPCTL peripheral
Set Output pins for each Port Direction of the Pins: GPIOxDIR PINs; input, output
Set PUR bits internal PullUp Resistor PDR PullDown Resistor ODR Open Drain for each Port : disable, enable
Set Digital ENable register on all port.pins GPIOxDEN PINs; disable, enable
Delay ms milliseconds MHz CPU Clock
void DelayMsint ms
volatile int i j;
for i ; i ms; i
for j ; j ; j Do nothing for ms
interface a sevensegment display to Tiva LaunchPad. The display counts from sim F begintabularccccccc
hline Device & Port.Pin & begintabularc
Signal
Type
endtabular & & Direction & begintabularc
Drive
Mode
endtabular
hline Sega & PA & Digital & GPIO & OUTPOS &
hline Segb & PA & Digital & GPIO & OUTPOS &
hline Segc & PA & Digital & GPIO & OUTPOS &
hline Segd & PC & Digital & GPIO & OUTPOS &
hline Sege & PC & Digital & GPIO & OUTPOS &
hline Segf & PC & Digital & GPIO & OUTPOS &
hline Segg & PC & Digital & GPIO & OUTPOS &
hline Segdp & PD & Digital & GPIO & OUTPOS &
hline begintabularll
SWOnbo
endtabular & PF & Digital & GPIO & INNEG & UP
hline begintabularll
SWOnbo
endtabular & Digital & GPIO & INNEG &
hline
endtabular Lab Experiments
Comment out the forloop code in the main function inside the whileloop.
while
Place your application code here
for i ; i sizeofsevenSeg; i
SegDisplaych & xF;
ch;
DelayMs;
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
