Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Please also draw me a flowchart that matches the logic of the code to be written. Write a C code to have the display count

Please also draw me a flowchart that matches the logic of the code to be written. Write a C code to have the display count up from 0-F with Sw1 and Sw2 on the board. 0x06,//10x4F,//30x6D,//50x07,//70x6F,//90x7C,// b 0x5E,// d 0x71,//fint main()
{int i = ;while (1){ SegDisplay(ch & 0x0F); DelayMs(1000);}
}
void SegDisplay(uint8_t d)
{seg = SevenSeg[?];
}
void Setup_GPIO(void)
{//1. Enable Clock to the GPIO Modules (SYSCTL->RCGCGPIO }|=\mathrm{(_PORTs);)// allow time for clock to stabilize (SYSCTL->PRGPIO & (PORTs))//2. Unlock GPIO only PD7, PF0 on TM4C123GGPIOD->CR |=_PIN7;GPIOF->LOCK =0x4C4F434B;GPIOF->LOCK =0; //4. Set Port Control Register for each Port (GPIOx->PCTL = PMCn PTCL_PINn, check the
PCTL table)
??5. Set Alternate Function Select bits for each Port (GPIOx->AFSEL = PINs; 0= regular I/O,1= PCTL
peripheral)
??6. Set Output pins for each Port (Direction of the Pins: GPIOx->DIR =_PINs; 0= input, 1= output)
//7. Set PUR bits (internal Pull-Up Resistor), PDR (Pull-Down Resistor), ODR (Open Drain) for each
Port (0 : disable, 1= enable)
??8. Set Digital ENable register on all port.pins (GPIOx->DEN = PINs; 0= disable, 1= enable)// Delay ms milliseconds (16MHz CPU Clock)
void DelayMs(int ms)
{for (i=0; i
When the user presses RESET (SW1) button, reset the counter value to zero and display
When the user presser COUNT (SW2) button, increase the counter value by 1 and displ the seven-segment display.
The counter only increases at the moment when the COUNT (SW2) button is pressed.
For this we will be using the Tiva C Series TM4C123GXL board the pin configuration for the microcontroller is shown below. Please follow the Sourc Code format provided.
Source Code format to be followed.
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Big Data Fundamentals Concepts, Drivers & Techniques

Authors: Thomas Erl, Wajid Khattak, Paul Buhler

1st Edition

0134291204, 9780134291208

More Books

Students also viewed these Databases questions

Question

Critically evaluate Freuds stages of psychosexual development.

Answered: 1 week ago

Question

=+1. What is the brand's character or personality?

Answered: 1 week ago

Question

=+3. Who is the audience?

Answered: 1 week ago

Question

=+4. What do they (audience members) currently think?

Answered: 1 week ago