Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

ECE2049: Homework3 3. Say you want to connect four slide-switches like the one shown at the right to P6.1 and P4.6-4. The switches operate such

image text in transcribed

ECE2049: Homework3 3. Say you want to connect four slide-switches like the one shown at the right to P6.1 and P4.6-4. The switches operate such that when the switch is slid to the right, the pin is connected to GND (OV), and when slid to the left is connects to Vcc (3.3V). Would these switches be digital inputs or outputs? Based on the picture, what operation left or right) would correspond to a logic 1 or logic 0? a. b. Howis the functionality of the switch different from a push button like those we use in lab)? In other words, when might you want to use slide switches instead of buttons? c. Complete the two fiunctions config itches and read itches Your code must be typed-you can find Vcc Pty based on the skeleton below. this e as a C file on the course website as switches.c. /Function prototypes roid config sritches (roid) char read arirches void)a Exanple mainl to demonstrate hor the Eunctions are used--no need to modifr it void main (void char vai: NDTCTL=?DTF7 + WDTHOLD; configawitches // 3top ratchdog tiner hile (11 Assume something ith val happens here vod config srirches (void) // Configure sritahes here! Return a value betreen 0-Fh corresponding // to the value of the ?tches, rith the valu!! of each awitch in the folloring bit positions: MSE Bit: 7-4 it 3 2 L35 char read_aritches (void) char re valD / Read eritches and place the output into the appropriate bit here! return ret val: Assuming that your program has properly configured the slide switches, what should the d. function read witchesreturn given the following register values? ECE2049: Homework3 3. Say you want to connect four slide-switches like the one shown at the right to P6.1 and P4.6-4. The switches operate such that when the switch is slid to the right, the pin is connected to GND (OV), and when slid to the left is connects to Vcc (3.3V). Would these switches be digital inputs or outputs? Based on the picture, what operation left or right) would correspond to a logic 1 or logic 0? a. b. Howis the functionality of the switch different from a push button like those we use in lab)? In other words, when might you want to use slide switches instead of buttons? c. Complete the two fiunctions config itches and read itches Your code must be typed-you can find Vcc Pty based on the skeleton below. this e as a C file on the course website as switches.c. /Function prototypes roid config sritches (roid) char read arirches void)a Exanple mainl to demonstrate hor the Eunctions are used--no need to modifr it void main (void char vai: NDTCTL=?DTF7 + WDTHOLD; configawitches // 3top ratchdog tiner hile (11 Assume something ith val happens here vod config srirches (void) // Configure sritahes here! Return a value betreen 0-Fh corresponding // to the value of the ?tches, rith the valu!! of each awitch in the folloring bit positions: MSE Bit: 7-4 it 3 2 L35 char read_aritches (void) char re valD / Read eritches and place the output into the appropriate bit here! return ret val: Assuming that your program has properly configured the slide switches, what should the d. function read witchesreturn given the following register values

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

Oracle Autonomous Database In Enterprise Architecture

Authors: Bal Mukund Sharma, Krishnakumar KM, Rashmi Panda

1st Edition

1801072248, 978-1801072243

More Books

Students also viewed these Databases questions