Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Each team is to create and debug a C program to meet the following specifications: 1. decade up/down counter: count up or down from 0

image text in transcribed

Each team is to create and debug a C program to meet the following specifications: 1. decade up/down counter: count up or down from 0 to 9, and repeat 2. controlled by two switches, S1 and S2 a. S1: start/stop (1-start, 0 stop) b, S2: direction (1 count down, 0 = count up) 3. switch connections on the microcontroller a. S1: I/O port pin PA1 connected to DIO0 on the EEBoard 4. Changing S2 while counting is enabled (S1-1) should change the count direction 5. Display the count value by writing to port pins PC[3:0]. In the laboratory, these 6. Count period is to be approximately 0.5 s b. S2: /O port pin PA2 connected to DIO1 on the EEBoard on the next count change. lines will be connected to four virtual LEDs. Prior to lab, design the C program with a main program, and two separate "functions" as follows. The main program is to initialize port directions and variables, and then execute in an endless loop, calling the delay function, setting the direction variable based on position of switch S2, and calling the counting function if counting is enabled by switch Si * 12 ~ ELEC 3040/3050 Lab Manual Lab 2 Revised 8/20/14 A delay function is to implement a half-second time delay ("do nothing" for about half a second). If time permits, try to get the delay function to be accurate within 10% of the nominal value (0.5 seconds +/-10%), or better A counting function is to increment or decrement the count, according to the setting of a direction variable passed as a parameter from main, and display the new value on the LEDs. The count value is to be a static global variable. *

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

Database Theory Icdt 99 7th International Conference Jerusalem Israel January 10 12 1999 Proceedings Lncs 1540

Authors: Catriel Beeri ,Peter Buneman

1st Edition

3540654526, 978-3540654520

More Books

Students also viewed these Databases questions

Question

5. Recognize your ability to repair and let go of painful conflict

Answered: 1 week ago