subject

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 () and 3
• IE: interrupt enable bit (I: enable/ (): 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: 0011 1000
CLK_6: 0011 0000
CLK_0: 0000 0000
CAP_3: 0000 0110
CAP_0: 0000 0000
IE_1: 0000 0001
IE_0: 0000 0000

Required:
a. Write a line of code that configures the module as the following:
(Sleep mode 1)(Clock speed 5)(Capacitor value 2)(Interrupts enabled)
b. For the operation above, show the masks used and the final value of CTL in binary.
c. Write a piece of code that changes SLP to 2. The current value of SLP is unknown.
d. Write a piece of code that changes CLK to 6. The current value of CLK is unknown.
e. Write an if-condition line that checks if SLP=2.
f. Write an if-condition line that checks if CLK=6.
g. Write an if-condition that checks if the current value of CLK is either of (0, 2, 4, 6).

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 11:00
When working with a team you should always do the following, except? question 3 options: be dependable and trustworthy be sensitive to others feelings do your fair share critique members of the group
Answers: 2
question
Computers and Technology, 22.06.2019 16:30
You have inserted new slides based on a word outline. how do you format these new slides to match the powerpoint presentation formatting? a. select all slides in the presentation and click format on the home tab. b. select the new slides and click reset on the home tab. c. select all slides in the presentation and click reset on the home tab. d. select the new slides and click format on the home tab.
Answers: 2
question
Computers and Technology, 22.06.2019 17:00
Acase study allows a more detailed look at the life of a single subject than any other study.
Answers: 3
question
Computers and Technology, 23.06.2019 15:00
Plz ( which is an example of a good url?
Answers: 1
You know the right answer?
A module on the microcontroller is configured using a control register called CTL that has the forma...
Questions
question
Computers and Technology, 05.01.2021 16:40
Questions on the website: 13722367