Question: Please help. Please show your work and highlight/circle final answers. Need help with all parts. QUESTION 9. (10 points) A module on the microcontroller is

Please help. Please show your work and highlight/circle final answers. Need help with all parts.

Please help. Please show your work and highlight/circle final answers. Need help

QUESTION 9. (10 points) A module on the microcontroller is configured using a control register called CTL that has the format shown below. SLP CLK CAP IE 2- 3- 2- 1- . SLP: selects sleep mode; value between 0 and 3 CLK: selects clock speed; value between 0 and 7 CAP: selects built-in capacitor value; choice between 0 and 3 IE: interrupt enable bit (1: enable/O: disable) . To support programming the device, the environment has declared the symbolic constants: SLP 3: 1100 0000 SLP 2: 1000 0000 SLP 1: 0100 0000 SLP 0: 0000 0000 CLK 7: CLK 6: 0011 1000 0011 0000 CLK 0: 0000 0000 0000 0110 CAP_3: -3- CAP_0: 0000 0000 IE: 0000 0001 Perform all the operations below using the masks defined above. Parta) Write a line of code that configures the module as the following: (Sleep mode 2) (Clock speed 6) (Capacitor value 1) (Interrupts enabled) Part b) For the operation above, show the masks used and the final value of CTL in binary. Parte) Write a piece of code that changes SLP to 1. The current value of SLP is unknown. Part d) Write a piece of code that changes CLK to 6. The current value of CLK is unknown. Part e) Write an if-condition line that checks if SLP=2. Part 1) Write an if-condition line that checks if CLK=3. Part g) Write an if-condition that checks if the current value of CLK is either of (0, 2, 4, 6). QUESTION 9. (10 points) A module on the microcontroller is configured using a control register called CTL that has the format shown below. SLP CLK CAP IE 2- 3- 2- 1- . SLP: selects sleep mode; value between 0 and 3 CLK: selects clock speed; value between 0 and 7 CAP: selects built-in capacitor value; choice between 0 and 3 IE: interrupt enable bit (1: enable/O: disable) . To support programming the device, the environment has declared the symbolic constants: SLP 3: 1100 0000 SLP 2: 1000 0000 SLP 1: 0100 0000 SLP 0: 0000 0000 CLK 7: CLK 6: 0011 1000 0011 0000 CLK 0: 0000 0000 0000 0110 CAP_3: -3- CAP_0: 0000 0000 IE: 0000 0001 Perform all the operations below using the masks defined above. Parta) Write a line of code that configures the module as the following: (Sleep mode 2) (Clock speed 6) (Capacitor value 1) (Interrupts enabled) Part b) For the operation above, show the masks used and the final value of CTL in binary. Parte) Write a piece of code that changes SLP to 1. The current value of SLP is unknown. Part d) Write a piece of code that changes CLK to 6. The current value of CLK is unknown. Part e) Write an if-condition line that checks if SLP=2. Part 1) Write an if-condition line that checks if CLK=3. Part g) Write an if-condition that checks if the current value of CLK is either of (0, 2, 4, 6)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!